Documente Academic
Documente Profesional
Documente Cultură
Configuring the MTA is far not enough to prevent spam. One of the most powerful
anti-spam tools is probably SpamAssassin.
SpamAssassin (SA) is a perl-program which checks email. According to these
various checks, SA will rate the mail with Spampoints.
Many Spampoints = bad (e.g. most likely spam)
Few Spampoints (or better: negative Spampoints) = good (e.g. most likely ham).
Per default a message is flagged as Spam as soon as it has more than 5 SA-Spam-
Points.
Install ProcMail:
$ apt-get install procmail
-> procmail will deliver the mail to the correct mail- or
spamfolder by reading the Spam/Ham-Flag in the mail-header.
step2:
create user debian-spamd with home directory /var/lib/spamassassin
Step3:
- edit /etc/default/spamassassin
-> ENABLED=1 # starts spamd at boot-time
#add line
SAHOME="/var/lib/spamassassin/"
OPTIONS="--create-prefs --max-children 5 --username debian-spamd
--helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log "
#set
cron=1 #for update
Step4:
- edit /etc/exim4/exim4.conf.template
# add this line at the top of the file:
local_scan_path = /usr/lib/exim4/local_scan/sa-exim.so
- edit /etc/exim4/sa-exim.conf
# change values to fit your needs
# example: reject all mails with a spam-score > 14
SApermreject: 14.0
#####################################################################
##############
# description: greylist a mail which has a spam-score of 9.0 or
higher (between 9.0 and 14.0 if you have the permreject of above)
# the mail will be temp-rejected for 1800 seconds (most spammers
only send the mail once)
- edit /etc/exim4/sa-exim.conf
SAtempreject: 9.0
SAgreylistiswhitestr: GREYLIST_ISWHITE
SAgreylistraisetempreject: 4.0
- edit /etc/spamassassin/local.cf
# add the following 4 lines:
loadplugin Greylisting
/usr/share/perl5/Mail/SpamAssassin/Plugin/Greylisting.pm
header GREYLIST_ISWHITE eval:greylisting("( 'dir' =>
'/var/spool/sa-exim/tuplets'; 'method' => 'dir'; 'greylistsecs' =>
'1800'; 'dontgreylistthreshold' => 11; 'connectiphdr' => 'X-SA-Exim-
Connect-IP'; 'envfromhdr' => 'X-SA-Exim-Mail-From'; 'rcpttohdr' =>
'X-SA-Exim-Rcpt-To'; 'greylistnullfrom' => 1; 'greylistfourthbyte' =>
0 )")
describe GREYLIST_ISWHITE The incoming server has been freed of
graylisting for this recipient and sender
score GREYLIST_ISWHITE -1
#####################################################################
##############
bayes_path /var/spamassassin/bayes
report_safe 0
rewrite_subject 0