A UNIX-based email server with an optional web interface allows you to manage your email client and get email through a web browser. In addition to handling all the common email types, it is a good idea to set up a forwarders list and have postmaster/transportd set up relays with as many spam filtering techniques as you can think of. t is best to go all out and set up a full mail server.
In this chapter, we will set up a basic mail server. We will focus on the aspects of mail that pertain to the Internet. If you have a different MTA, you will have to modify the example to fit your use. The name of the SMTP server is mail, and it runs at port 25, just like the POP server. In addition, we will set up a mail user in PostgreSQL. If you decide to set up a mail server for the mail user, you will have to edit the config files to reflect your settings. By default, the mail user has the privileges of postmaster, that is, it has full access to the mail server. Once you set up this mail server, you can log in to it and check the mail queues, but you will not be able to send mail to it unless you set it up to forward mail. If you set up a forwarding server, you can send mail from your mail client to the forwarded mail server.
Default ports for SMTP servers are 53, and 25 if the MTA has multiple IP addresses or if the default IP is for external sources. Internet connections are at port 25 or port 587. It is best to use the ports you wish to use in the mail configuration, rather than those suggested by default. SMTP is a layer three protocol, whereas POP3 is layer four. SMTP is generally preferred to POP3 because it is more secure. Because SMTP is part of the TCP/IP suite, it is difficult to control access to the port it uses and is generally accepted as an open port. All mail servers must be able to communicate with one another to share mails. If the mail server is the only one that can authenticate, it must be able to send mail to and from other servers.
If you set up an SMTP server, you can give it a list of source servers that it can send mail from. You can set up a forwarders, that is, servers that are responsible for relaying mail sent to their own IP address from other servers on 0b46394aab