Installing MailScanner on Ubuntu Linux

This guide is based on work produced by Mohammed Alli and his work is gratefully acknowledged.

Remove Ubuntu's MailScanner

The setup of MailScanner distributed with Ubuntu is totally broken, as you may have already discovered. So delete it first with

/etc/init.d/mailscanner stop
apt-get remove mailscanner

Install MailScanner Dependencies

apt-get install libconvert-tnef-perl libdbd-sqlite3-perl libfilesys-df-perl libmailtools-perl libmime-tools-perl libmime-perl libnet-cidr-perl libsys-syslog-perl libio-stringy-perl libfile-temp-perl

Install MailScanner from the Debian .deb Source

dpkg -i mailscanner_4.68.8-1_all.deb

Note that the 4.68.8-1 in the 2 commands above should be replaced by the version number you want to install.
The version number of the latest distribution can be found on the Downloads page.

Configuring MailScanner and ClamAV

Stop Postfix:
postfix stop
Install the ClamAV packages:
apt-get install clamav clamav-daemon
Update the ClamAV virus definitions (only need to do this once)
Make directory for SpamAssassin and set permissions
mkdir /var/spool/MailScanner/spamassassin
chown postfix /var/spool/MailScanner/spamassassin
Backup and edit MailScanner.conf
cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.bak
vi /etc/MailScanner/MailScanner.conf
Set the following settings in MailScanner.conf
%org-name% = ORGNAME
%org-long-name% = ORGFULLNAME
%web-site% = ORGWEBSITE
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
Virus Scanners = clamav
Spam List = SBL+XBL
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
Postfix settings
postconf -e "header_checks = regexp:/etc/postfix/header_checks"
Edir header_checks
vi /etc/postfix/header_checks
Add this line to the file, without it nothing will work:
/^Received:/ HOLD
Disable permission checks on MailScanner directories
Comment out the lines that check directory permissions on /var/* in /etc/rc2.d/S20mailscanner
Set MailScanner to start at boot time
In the file /etc/default/mailscanner, make sure this is set to 1:
Start the system
/etc/init.d/mailscanner start
/etc/init.d/postfix start

Fix for Ubuntu 8.04

If it keeps removing directories when it boots, edit /etc/rc.local and add the following before the exit line:

mkdir /var/run/MailScanner
mkdir /var/lock/subsys
mkdir /var/lock/subsys/MailScanner
chown -R postfix:postfix /var/run/MailScanner
chown -R postfix:postfix /var/lock/subsys/MailScanner
/etc/init.d/postfix restart
/etc/init.d/mailscanner restart


You should now have a working MailScanner system running a very recent version of MailScanner, a lot better than the version distributed with Ubuntu.
For help and assistance, please join the mailing list.

MailScanner would like to thank the following for their support:


[Powered by Google]   Translate this page to 
Copyright 2006 © Julian Field/Mailscanner