If you’re running any moderately busy mail server you’re probably using spamassassins spamc/spamd to check for spam because its tons more efficient than piping the mail through the spamassassin cli. Assuming that you do, and that you plan on adding DKIM proxy to the mix to verify and sign emails you need to put things in the right order, to save you some headache here’s what I did:
- smtp|smtps => -o smtpd_proxy_filter=127.0.0.1:10035 # outgoing dkim verify port
- 127.0.0.1:10036 => -o content_filter=spamassassin
- spamassassin =>Â pipe user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} # this delivers to the “pickup” service
- pickup => -o content_filter=dksign:127.0.0.1:10037 # outgoing dkim signing port
- 127.0.0.1:10038 => -o content_filter= # the buck stops here
If you arent careful with these (which I wasnt) you’ll end up causing an infinite loop between your filters (which I did). Thus concludes our public service announcement.