E-mail Servers

For Fedora Core Linux servers (and other similar RedHat-based OSes):

1. Install sendmail, clamav, spamassassin (if not already there)

yum install sendmail
yum install clamav
yum install spamassassin

So long as you’ve got yum set to auto-update, these will all stay reasonably current.

2. Install MailScanner

Go to http://www.mailscanner.info and grab the latest RPM package, untar, install:

wget www.mailscanner.info/files/4/rpm/MailScanner-4.54.6-1.rpm.tar.gz
tar -zxvf MailScanner-4.54.6-1.rpm.tar.gz
cd MailScanner-4.54.6-1
./install.sh

And follow the instructions.

This will need repeating every now and again as new versions of MailScanner are released (unless someone knows of a yum repository that has MailScanner?).

3. Tweak MailScanner settings

If you’re using ClamAV, modify “MailScanner.conf” to have “Virus Scanners = clamav”.

If you’re using SpamAssassin, set “Use SpamAssassin = yes”.

You’ll probably want to tweak the “High SpamAssassin Score” and “Required SpamAssassin Score” to be lower (I use 4 and 6 at the moment) and perhaps automatically stop delivery (but store) high-scoring spam with “High Scoring Spam Actions = store delete”.

Over time you’ll probably do many more tweaks :)

4. Train the SpamAssassin Bayesian filter

SpamAssassin trains its filter automatically to a certain extent. I also have a user called spamhoneypot that gets all the e-mail messages sent to spammed but unused e-mail addresses on my server. I use this to periodically train the Bayesian filter using:

cd /var/spool/mail sa-learn --spam --mbox --progress spamhoneypot rm -f spamhoneypot