Another technique, I was font of was to integrate spamassassin as a SMTP milter, which are ﬁlters run before the messages are added to the queue and therefore can result in rejection of SPAM mails. I decided to put the problem back to the sender and don’t permit the SPAM to be stored on my hard disk. All you need to rejecting SPAM to the sender is the ubuntu packet
spamass-milter. Install it using the following command.
sudo aptitude install spamass-milter
Now you need to tell postﬁx, to use it and where it can be found. Put the following line somewhere in your conﬁguration ﬁle and make sure you do not chroot, set in
smtpd_milters = unix:/var/spool/postfix/spamass/spamass.sock
After an obligatory
postfix reload, the mailserver should run and parse all mails it receives. This includes adding the common spamassassin headers into the mails, which you can use for ﬁltering in your mail client.
Anyhow, if you really want to ‘reject’ mails using a speciﬁc score threshold, you will need to edit the ﬁle
/etc/default/spamass-milter, to meet your requirements. The value of the
-r option speciﬁes the threshold. You should adjust it to your needs. For completeness, I post an example:
# Default, use the nobody user as the default user, ignore messages # from localhost OPTIONS='-u spamass-milter -r 8 -i 127.0.0.1'
Of course, you will need to restart the spamass-milter daemon using
Cheers and enjoy, iss