Configure spamassassin
Spamassassin is the antispam system we 'll use
Enable Spamassassin
Edit /etc/default/spamassassin to change the options :
IP::Country::Fast perl installation
Install perl package (deb)
Take the latest version of IP database from http://mailfud.org/ip-country-fast/
mv cc.gif cc.gif.old
mv ip.gif ip.gif.old
wget http://mailfud.org/ip-country-fast/cc.gif
wget http://mailfud.org/ip-country-fast/ip.gif
cd /downloads/
Configure pyzor
Add the Pyzor servers by running the following command.
chmod 666 /etc/spamassassin/servers
OPTIONAL : If you want to report spam with the Vipul's Razor spam-reporting system
razor-admin -d -home=/etc/razor -register
Load additionnal plugins
Uncomment this in /etc/spamassassin/init.pre (line 22)
Uncomment this in /etc/spamassassin/v310.pre (line 24)
Uncomment this in /etc/spamassassin/v320.pre (line 53)
Enable additionnal features
Edit /etc/spamassassin/local.cf to change the following options :
Uncomment following lines
required_score 5.0use_bayes 1
bayes_auto_learn 1
Add following lines
score BAYES_99 5.300add_header all Relay-Country _RELAYCOUNTRY_
skip_rbl_checks 1
use_pyzor 1
pyzor_options --homedir /etc/spamassassin/
use_razor2 1
razor_config /etc/razor/razor-agent.conf
OPTIONAL : If you want to change mail classification based on relaying countries, add following lines in /etc/spamassassin/local.cf
describe RELAYCOUNTRY_BAD Relayed through China at some point
score RELAYCOUNTRY_BAD 3.0
header RELAYCOUNTRY_GOOD X-Relay-Countries =~ /^(BE|FR)/
describe RELAYCOUNTRY_GOOD Relayed through Belgium or France
score RELAYCOUNTRY_GOOD -0.2
Create a compiled version of some ruleset
Test configuration and start the service
systemctl start spamassassin
OPTIONAL : If you want qmail-smtpd to reject messages where the domain portion of the envelope sender is not a valid domain (feature non-related to spamassassin but added by patch qmail-1.03-mfcheck.3.patch.)
Users comments