interfasys
Verified User
System: RedHat 9, ClamAv 0.67, MailScanner 4.28, Exim 4.24
*********************************
Install Spamassasin
*********************************
# cd /usr/local/directadmin/scripts
# ./spam.sh
You can also tweak spam.sh so that it picks up the latest version.
!Do not modify exim.conf to use spamassassin!
!Do not load spamd
I'm still trying to figure out if spamd is needed by somebody...
*********************************
Install ClamAV
*********************************
# wget http://crash.fce.vutbr.cz/crash-hat/1/clamav/clamav-0.72-1.i386.rpm
# rpm -Uvh clamav*.rpm
!Do not setup a cron for updates
*********************************
Install MailScanner
*********************************
# wget http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/rpm/MailScanner-4.28.6-1.rpm.tar.gz
# tar -zxvf MailScanner-4.28.6-1.rpm.tar.gz
# cd MailScanner-4.28.6-1
# ./Update-MakeMaker.sh
# ./install.sh
# chown -R mail:mail /var/spool/MailScanner
Note : Install missing modules when asked
# chown -R mail:mail /var/spool/MailScanner
*********************************
Configure Exim
*********************************
We need to run two Exim daemons: one to listen for SMTP connections, and one to do queue runs on the outgoing spool directory.
Thus, we need two .conf files. One for each exim process. The one created by directadmin will be used for incoming emails, we will tweak that one.
Backup
# cp /etc/exim.conf /etc/exim.back
Duplicate
#cp /etc/exim.conf /etc/exim_outgoing.conf
Configure
# pico -w /etc/exim.conf
and add the following lines in the main part of the configuration:
spool_directory = /var/spool/exim.in
queue_only = true
queue_only_override = false
log_file_path = /var/spool/exim/msglog/%slog
# pico -w /etc/init.d/exim
Original:
QUEUE=
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -bd"
[ -n "$QUEUE" ] && EXIM_OPTS="$EXIM_OPTS -q$QUEUE"
Change this to:
QUEUE="15m"
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -bd"
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -C /etc/exim_outgoing.conf"
[ -n "$QUEUE" ] && EXIM_OPTS="$EXIM_OPTS -q$QUEUE"
Create the following directories: /var/spool/exim.in,
/var/spool/exim.in/input,
/var/spool/exim.in/data,
/var/spool/exim.in/db
# mkdir /var/spool/exim.in
etc.
and assign them to mail.
# chown mail:mail /var/spool/exim.in
*********************************
Configure MailScanner
*********************************
#pico -w /etc/MailScanner/MailScanner.conf
and change theses settings:
Use you language for reports
%report-dir% = /etc/MailScanner/reports/fr
%org-name% = (Your org. name)
Run As User = mail
Run As Group = mail
Incoming Queue Dir = /var/spool/exim.in/input
Outgoing Queue Dir = /var/spool/exim/input
MTA = exim
Sendmail = /usr/sbin/exim -C /etc/exim.conf
Sendmail2 = /usr/sbin/exim -C /etc/exim_outgoing.conf
Virus Scanners = clamav
Use SpamAssassin = yes
Always Include SpamAssassin Report = yes
# pico -w /etc/sysconfig/MailScanner
MTA=exim
EXIM=/usr/sbin/exim
EXIMINCF=/etc/exim.conf # Incoming configuration file
EXIMSENDCF=/etc/exim_outgoing.conf # Outgoing configuration file
*********************************
Antivirus Auto-update
*********************************
Modify ClamAV scanner
# pico -w /usr/lib/MailScanner/clamav-autoupdate
Change this:
$PackageDir = "/usr";
$LogFile = "/var/log/clam-update.log";
$LockFile = "/var/log/ClamAVBusy.lock";
*********************************
Test MTA
*********************************
Stop the MailScanner process if it's running and restart the exim processes
# service MailScanner stop
# service exim restart
Try to send an email to an account that the exim is handling. When the email arrives it should be placed in the /var/spool/exim.in/input
directory. If it doesn't then the exim incoming process isn't working properly.
Now start the MailScanner.
# service MailScanner start
The email should now be moved from the directory and moved to /var/spool/exim/input where
it will be processed by the outgoing exim process.
You can view /var/log/maillog to see if the MailScanner scanned the file.
If the last two steps aren't working check the /var/log/maillog, /var/log/exim/exim_*,
/var/spool/exim/msglog/* for errors.
*********************************
Officially launch MailScanner
*********************************
Now that we've checked that everything is working, we can officially launch Mailscanner on the server.
# service exim stop
# service MailScanner stop
# killall exim
# service MailScanner start
If properly configured, Mailscanner will launch exim and scan your emails.
*********************************
Test virus scanner
*********************************
Try to send an email with a virus included and see if MailScanner detects it.
Just type this in a virus.txt file :
$CEliacmaTrESTuScikgsn$FREE-TEST-SIGNATURE$EEEEE$
and attach it in a test email.
------------------------------------------------------------------------
Original Howto made by :
Kaare Christensen, Mermaid Consulting ApS
kaare[at]mermaidconsulting[dot]com
http://www.mermaidconsulting.com
*********************************
Install Spamassasin
*********************************
# cd /usr/local/directadmin/scripts
# ./spam.sh
You can also tweak spam.sh so that it picks up the latest version.
!Do not modify exim.conf to use spamassassin!
!Do not load spamd
I'm still trying to figure out if spamd is needed by somebody...
*********************************
Install ClamAV
*********************************
# wget http://crash.fce.vutbr.cz/crash-hat/1/clamav/clamav-0.72-1.i386.rpm
# rpm -Uvh clamav*.rpm
!Do not setup a cron for updates
*********************************
Install MailScanner
*********************************
# wget http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/rpm/MailScanner-4.28.6-1.rpm.tar.gz
# tar -zxvf MailScanner-4.28.6-1.rpm.tar.gz
# cd MailScanner-4.28.6-1
# ./Update-MakeMaker.sh
# ./install.sh
# chown -R mail:mail /var/spool/MailScanner
Note : Install missing modules when asked
# chown -R mail:mail /var/spool/MailScanner
*********************************
Configure Exim
*********************************
We need to run two Exim daemons: one to listen for SMTP connections, and one to do queue runs on the outgoing spool directory.
Thus, we need two .conf files. One for each exim process. The one created by directadmin will be used for incoming emails, we will tweak that one.
Backup
# cp /etc/exim.conf /etc/exim.back
Duplicate
#cp /etc/exim.conf /etc/exim_outgoing.conf
Configure
# pico -w /etc/exim.conf
and add the following lines in the main part of the configuration:
spool_directory = /var/spool/exim.in
queue_only = true
queue_only_override = false
log_file_path = /var/spool/exim/msglog/%slog
# pico -w /etc/init.d/exim
Original:
QUEUE=
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -bd"
[ -n "$QUEUE" ] && EXIM_OPTS="$EXIM_OPTS -q$QUEUE"
Change this to:
QUEUE="15m"
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -bd"
[ -f /etc/sysconfig/exim ] && . /etc/sysconfig/exim
[ "$DAEMON" = yes ] && EXIM_OPTS="$EXIM_OPTS -C /etc/exim_outgoing.conf"
[ -n "$QUEUE" ] && EXIM_OPTS="$EXIM_OPTS -q$QUEUE"
Create the following directories: /var/spool/exim.in,
/var/spool/exim.in/input,
/var/spool/exim.in/data,
/var/spool/exim.in/db
# mkdir /var/spool/exim.in
etc.
and assign them to mail.
# chown mail:mail /var/spool/exim.in
*********************************
Configure MailScanner
*********************************
#pico -w /etc/MailScanner/MailScanner.conf
and change theses settings:
Use you language for reports
%report-dir% = /etc/MailScanner/reports/fr
%org-name% = (Your org. name)
Run As User = mail
Run As Group = mail
Incoming Queue Dir = /var/spool/exim.in/input
Outgoing Queue Dir = /var/spool/exim/input
MTA = exim
Sendmail = /usr/sbin/exim -C /etc/exim.conf
Sendmail2 = /usr/sbin/exim -C /etc/exim_outgoing.conf
Virus Scanners = clamav
Use SpamAssassin = yes
Always Include SpamAssassin Report = yes
# pico -w /etc/sysconfig/MailScanner
MTA=exim
EXIM=/usr/sbin/exim
EXIMINCF=/etc/exim.conf # Incoming configuration file
EXIMSENDCF=/etc/exim_outgoing.conf # Outgoing configuration file
*********************************
Antivirus Auto-update
*********************************
Modify ClamAV scanner
# pico -w /usr/lib/MailScanner/clamav-autoupdate
Change this:
$PackageDir = "/usr";
$LogFile = "/var/log/clam-update.log";
$LockFile = "/var/log/ClamAVBusy.lock";
*********************************
Test MTA
*********************************
Stop the MailScanner process if it's running and restart the exim processes
# service MailScanner stop
# service exim restart
Try to send an email to an account that the exim is handling. When the email arrives it should be placed in the /var/spool/exim.in/input
directory. If it doesn't then the exim incoming process isn't working properly.
Now start the MailScanner.
# service MailScanner start
The email should now be moved from the directory and moved to /var/spool/exim/input where
it will be processed by the outgoing exim process.
You can view /var/log/maillog to see if the MailScanner scanned the file.
If the last two steps aren't working check the /var/log/maillog, /var/log/exim/exim_*,
/var/spool/exim/msglog/* for errors.
*********************************
Officially launch MailScanner
*********************************
Now that we've checked that everything is working, we can officially launch Mailscanner on the server.
# service exim stop
# service MailScanner stop
# killall exim
# service MailScanner start
If properly configured, Mailscanner will launch exim and scan your emails.
*********************************
Test virus scanner
*********************************
Try to send an email with a virus included and see if MailScanner detects it.
Just type this in a virus.txt file :
$CEliacmaTrESTuScikgsn$FREE-TEST-SIGNATURE$EEEEE$
and attach it in a test email.
------------------------------------------------------------------------
Original Howto made by :
Kaare Christensen, Mermaid Consulting ApS
kaare[at]mermaidconsulting[dot]com
http://www.mermaidconsulting.com
Last edited: