Getting Mail from the Server (POP)

Getting Mail from the Server (POP)

Once you have set up your mail server, you will want to let users access their e-mail from that server. That means either having each user log in to the mail server to read their e-mail or, more likely, configuring Post Office Protocol (POP) or IMAP to let them download mail to their workstations.

This section describes how to use POP to allow the users of your mail server to download their mail messages from your server over the network. POP is the more common and simpler of the two protocols for accessing mailboxes over networks.

Accessing mailboxes in Linux

When e-mail messages are received on your sendmail or postfix mail server, they are sorted to separate files, each of which represents a user's mailbox. The default location of mailbox files is the /var/spool/mail directory. So the login account jsmith would have a mailbox:

/var/spool/mail/jsmith

While logged into the mail server, jsmith could simply type mail from a Terminal window to read his e-mail (using the simple, text-based mail command). However, because most people prefer to get their e-mail from the comfort of their own desktop computer, you can set up either Post Office Protocol (POP) or Internet Message Access Protocol (IMAP).

POP and IMAP servers listen on the network for requests for a user's e-mail, then either download the entire contents of the mailbox to the user's mail reader (as with POP) or let the user manage the messages while the messages stay on the server (as with IMAP).

Typically, your mail server will be configured to use either POP or IMAP to provide e-mail messages to your users (though it is possible to have both running on the same machine).

The next section tells how to set up a POP service to allow access to e-mail accounts. This service requires that you have the imap RPM package installed on the server.

Tip?

At times, you may want to check your e-mail on a computer that is not your regular computer, but be able to save messages later. In that case, most mail readers let you choose a setting that copies the e-mail messages without deleting them from your POP server. That way, when you get back to your regular computer, you can download the messages again.

Configuring POP

By configuring a POP server to listen for requests from the network, your mail server's users can download their e-mail messages from another computer on the network. The following procedure describes how to turn on your POP service.

  1. Turn on the POP service by typing the following (as root user):

    # chkconfig ipop3 on
    
  2. Start the POP service immediately by restarting the xinetd super-server as follows:

    # /etc/init.d/xinetd restart
    
    Note?

    Most e-mail clients support POP3. However, if you are using older mail readers, you can start ipop2 instead of ipop3 as shown previously. If your users use mail readers that have SSL support, you can use the pop3s service instead, so that downloaded mail is encrypted (for better security).

All users that have user accounts on your mail server are configured, by default, to accept e-mail. For example, if e-mail comes in to the mail.handsonhistory.com server for a user named jsmith, the message is copied to the /var/spool/mail/jsmith file on the server. Continuing the example, from jsmith's computer, he could set up his mail reader as follows:

  • Mail server: mail.handsonhistory.com

  • User name: jsmith

  • Password: theuserspassword

  • Protocol: POP3

After the mail reader is configured, when jsmith clicks Send & Receive from his mail reader, all e-mail messages in the /var/spool/mail/jsmith file are downloaded to his local mail reader. The messages are then erased from the server.

Note?

If none of your users are able to download messages from your mail server, check that your firewall (iptables or ipchains) is configured to allow access to the POP service. By default, pop3 listens on port 110, pop2 listens on port 109, and pop3 with ssl support listens on port 995.




Part IV: Red Hat Linux Network and Server Setup