E-mail Server
Here are the things you will probably want to install on your e-mail server. Install the system foundation then the items below as desired.
After installing the MTA software, you will probably want to also install virus and spam scanners, instructions for which are found on the Mail Scanners page.
Choosing the Server Software
The main contenders for Linux e-mail server software are:
- Exim (official site)
- Sendmail (official site)
- Postfix (official site)
For a decent comparison of these, you can check out this web site. Exim is the favoured MTA on this web site. With my thus far limited experience with Exim I see no reason to disagree but don't yet have enough evidence to entirely agree either.
I started installing Exim in mid-2008 and have found it to be easier to configure, although not as flexible as Sendmail. Postfix is the MTA supplied with the Macintosh Xserver. I installed one Xserver and did not see any obvious reason why they chose Postfix over Exim or Sendmail.
I have used Sendmail for years and still use it on most of the servers I manage because it has been around for a long time (since 1982), has been reliable for the modest amount of traffic my servers push, has many features upon which I have come to rely and haven't figured out how to duplicate with Exim, and because I have figured out a set of configuration options and plug-ins that work well for me.
Sendmail is probably the most flexible of all MTAs although its configuration is generally considered to be cryptic and hard to learn (although decent tutorials and books are available, such as this one).
Postfix, according to their web site, “attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different.”
Installation
Using Gentoo Portage
Be sure you have all the necessary USE flags set, such as:
- sendmail (if you choose to use Sendmail)
- exim and exiscan-acl (if you choose to use Exim)
- clamav 1)
- spamassassin 2)
You can also refer to the Configuring your server build environment file.
Then install your choice of software:
emerge -va sendmail
or
emerge -va exim
or
emerge -va postfix
From source
I have only installed Sendmail from source, so that's the only package I'll cover here. You can use these instructions for any distribution, even Gentoo.
First, obtain the source code from http://www.sendmail.org/releases and then unpack the it in a working directory. For example:
mkdir /tmp/sendmail cd /tmp/sendmail wget ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.14.2.tar.gz tar -xzf sendmail.8.14.2.tar.gz ls cd sendmail-8.14.2 ./Build ./Build install
When you run the ls command you will see the name of the newly-created directory. In the case of version 8.14.2, it will be sendmail-8.14.2 so you don't need to run ls, but of course a new release will have a different directory name.
If you run into problems compiling the source, have a look at the official Sendmail documentation available from here.
Configuration
I won't cover Postfix since my experience with it is limited to the Macintosh Xserve.
Tips
A collection of short tips for Sendmail can be found here.