First install the package:
sudo apt-get install spamassassin spamc(You will need the spamassassin client later).
By default, Spamassassin logs into syslog. So you do not need to modify /etc/spamassassin/local.cf. You do need to enable Spamassassin by enabling launching the spamd daemon. Modify /etc/default/spamassassin by setting:
ENABLED=1This will do the trick.
Finally you need to modify /etc/postfix/master.cf. Edit the line:
smtp inet n - - - - smtpdto
smtp inet n - - - - smtpd -o content_filter=spamassassinand add:
spamassassin unix - n n - - pipeto the end of the file (you have to indent line 2 and 3 in order to maintain the logic of filters). You also might find these lines in different forums. They suggest creating a new user account "spamd". I was reluctant to do this as it roadens the attack surface to the server. Starting Spamassassin with user nobody works perfectly fine.
user=nobody argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
Start Spamassassin and restart Postfix and there you are.
1 comment:
thanks for blogging this :)
Post a Comment