Migrate to a New Server for Exim4 + Spamassassin + ClamAV

I've done this three times now, and it's pretty simple. If you're using a VM environment, 1GB RAM and 5GB of disk are enough. Start with Ubuntu 12.04 Server, and install it with only the SSH option.

If you want to save space, remove apache2, postfix, dovecot, mysql-server, mysql-client, php5, and related packages.

The install the following packages:
exim4
spamassassin
sa-exim
samba
clamav-freshclam
clamav-daemon

On the old server, tar up /etc/exim4, /etc/samba/.

Dump the Spamassassin bayesian database:
sudo sa-learn --backup > /etc/spamassassin/sa.backup

tar up /etc/spamassassin too. You probably have some local rules in there.

Untar your archives onto the new machine. Train Spamassassin:

sudo sa-learn --restore /etc/spamassassin/sa.backup

Edit the /etc/samba/smb.conf file to get rid of any extraneous shares.

Edit /etc/exim4/update-exim4.conf.conf and change the IP addresses. (Also, edit /etc/network/interfaces to what you want, with static addresses.)

Recreate the /home/Spamassassin directory, or tar up the original and untar it into the new machine.

Testing

Spamassassin:

Using tbird, make an .eml file and save it to the server.

spamc the.eml.file.eml

Clamav:

clamscan /tmp
clamdscan /tmp

Go to http://www.eicar.org/86-0-Intend... and make an EICAR file. Test.

Exim4:

mail foo@yourdomain.com

Email the EICAR from the server to yourself, and see it's detection in the logs.