I'm trying to set up an MX server using Postfix, postscreen and SpamAssassin.
According to the SpamAssassin documentation, I have to add -o content_filter to the smtp service in master.cf. This works with the default settings for Postfix, which is to use the smtpd command:
# SpamAssassin works:
smtp inet n - y - - smtpd
-o content_filter=spamassassin
spamassassin unix - n n - - pipe
user=spamd argv=/usr/local/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
But I also want to use postscreen. In order to use Postscreen, the smtpd command has to be replaced with the postscreen command. When I do that, postscreen works, but SpamAssassin stops working.
# SpamAssassin does not work:
smtp inet n - y - - postscreen
-o content_filter=spamassassin
spamassassin unix - n n - - pipe
user=spamd argv=/usr/local/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
It appears that the postscreen command does not respect the -o flag? When I set content_filter in main.cf it works, but then I have to disable it for all other services than postscreen, that would get really messy in master.cf because i'd have to add -o to all other services.
What is the best way to use both postscreen and SpamAssassin?