<< Tips and utilities | Home | Secure POP3 with stunnel >>

Postfix and POP3 server

step 5

Back to the introduction

In this step I am testing a firts version of the email server with postfix (SMTP on port 25) and POP3 server (on port 110) of the Pi card. You also need xinetd to host the pop3 daemon

  1. Install (apt-get) the following three packages: postfix, solid-pop3d, xinetd
  2. Configure postfix by editing /etc/postfix/main.cf. I have applied to that file all the settings inherited from my existing postfix email server (on my main computer), including filters, blacklists and other. To understand all the configuration required, please refer to the postfix documentation.
  3. After installing xinetd, you can add a pop3 service by creating a file pop3 in /etc/xinet.d with this section in it
    service pop3
            id              = pop3
            port            = 110
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = root
            server          = /usr/sbin/solid-pop3d
            flags           = IPv4
    Then restart xinet
    sudo /etc/init.d/xinet restart
    check that pop3 is available
    chkconfig -l
    and test that port 110 is open on your local network. This can be done from another computer on your LAN by:
    telnet raspberrypi 110
  4. Create a new account on your system to receive emails, and, if required, modify the /etc/aliases file to include rerouting from your public email address to this new account: Add an entry in that file like
    x: y
    where x is the first part of my official email address (e.g. x@mydomain.com), and y is my new account login name in the Pi card. Remember to run the newaliases comand to save the changes from this text file
  5.  Now your card should have both ports 25 and 110 open, and you can reconfigure your router to open these channels to the outside word and test sending an email from outside and retrieving it back using the POP3 server.
  6. Check the mail logs in /var/log to see the communication on port 25 (when an email arrives). These logs are very useful to spot wrong configuration in postfix (when restarting the postfix daemon) and other problems. I am using gnome-system-log


Add a comment Send a TrackBack