Pop smtp

From SRS

Jump to: navigation, search

Configure POP and SMTP services on a dialup

There are several howtos around to configure sendmail / fetchmail, but most of them give rather sketchy information on how to configure sendmail on a dialup.

Here's a set of short howtos on how to configure various Unix MTAs to run a mailserver on a dialup

Fetchmail

Fetchmail is a great command line pop client, written by the legendary Eric S. Raymond (esr).

The original ESR fetchmail doesnt appear to be maintained and is insecure. I would suggest that you use this updated version of fetchmail.

It can be configured quite easily using an X based interface called fetchmailconf. Alternatively, you can just edit a file called .fetchmailrc in your home directory, which looks like:

        defaults
        forcecr
        poll pop.your-isp.com with proto pop3 no dns
        user your-username with password your-password
        fetchall

See the fetchmail FAQ for more.

Wrapup

We now have a MTA that queues mail sent to non local addresses for delivery through a smarthost (say your ISP's smtp server). We also have fetchmail configured to poll your ISP's pop server for e-mail.

Now to automate the whole thing, so that you can fetch mails from your ISP's server and send all queued mails as soon as you dial into your ISP.

Create a file called /etc/ppp/ip-up.local which contains

        #!/bin/sh
        # use the line below for 
        # sendmail or postfix
        /usr/sbin/sendmail -q &
        # use this one for exim
        # /usr/exim/bin/exim -qff -v 
        /usr/bin/fetchmail -v &
        echo "Finished Fetching"
        /usr/bin/killall pppd
        /usr/bin/killall wvdial

Now, make this file owned by root (if you create it as root, that'll be the case) and give it execute permissions using

        'chmod +x /etc/ppp/ip-up.local'
Personal tools