Wednesday 11 January 2012

Integrating SpamAssassin with Exim4

Spam can be a real headache.!!!!

We used Spam Assassin to get rid of Spams in our mailserver, Exim4 running in Debian Squeeze.

The given setup will lead to mails having a spam score greater than 5, as determined by Spamassassin, to be rejected.


First, the packages need to be installed:

sudo apt-get install exim4-daemon-heavy  sa-exim  spamassassin


In /etc/default/spamassassin set the following lines:

ENABLED=1

The option lets the spamassassin daemon (spamd) start on boot.


Start spamassassin :

service spamassassin start


Now in /etc/exim4/exim4.conf.template, Insert the following lines in MAIN CONFIGURATION SETTINGS:

local_scan_path = /usr/lib/exim4/local_scan/sa-exim.so


To enable Exim’s spamassassin connector, in the file /etc/exim4/sa-exim.conf ,comment the following line:

#SAEximRunCond: 0


By default debugging is enabled. If you dont have enough storage change the value to 0 since it may generate very large log files :

SAEximDebug: 0


The updated file /etc/exim4/exim4.conf.template becomes active by running the following line:

/usr/sbin/update-exim4.conf 


Then restart Exim4

/etc/init.d/exim4 restart




Incase you haven't made SAEximDebug: 0, the logs can be examined to see if the spams are being rejected properly

Logs are located at /var/log/exim4/rejectlog

No comments:

Post a Comment