2017/03/01 Archives

01-03-2017 17:48

Postfix and spamassasin

The issue is mail that comes into a postfix server destined for an external address (think group addresses) will skip procmail. Spamassasin only rewrites headers, it does not delete mail. As a result, mail that is even detected and marked as spam are sent out on to users that are external making your mail server a spam bot. I found many tutorials online around this. See references. The answer was in the value set to postfix option, content_filter, in master.cf config. Here you put a name of a transport that filters mail and then puts it back in the queue (or deletes it etc). I had spamassasin there that was defined later in the config to use spamc. Again, this won't delete anything.

So I created my own script, a variant on what I saw is in the tutorials and deleted mail marked spam. After some typos and speling mistakes, it was all working. I added a logger line when deleting an email so there's more fo a record.

Ref: http://www.postfix.org/FILTER_README.html#simple_filter http://www.akadia.com/services/postfix_spamassassin.html https://joost.vunderink.net/blog/2011/04/23/deleting-spam-with-postfix-and-spamassassin/


Posted by DaveQB | Permanent Link | Categories: IT