Spamass-Milter for Rejecting SPAM Before Queueing

Another technique, I was font of was to integrate spamassassin as a SMTP milter, which are filters 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 postfix, to use it and where it can be found. Put the following line somewhere in your configuration file and make sure you do not chroot, set in /etc/postfix/

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 filtering in your mail client.

Anyhow, if you really want to ‘reject’ mails using a specific score threshold, you will need to edit the file /etc/default/spamass-milter, to meet your requirements. The value of the -r option specifies the threshold. You should adjust it to your needs. For completeness, I post an example: /etc/default/spamass-milter:

# Default, use the nobody user as the default user, ignore messages
# from localhost
OPTIONS='-u spamass-milter -r 8 -i'

Of course, you will need to restart the spamass-milter daemon using

/etc/init.d/spamass-milter restart

Cheers and enjoy, iss