Score:0

Using both SpamAssassin and postscreen in Postfix

cn flag

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?

Score:1
jp flag
Dom

I don't know which documentation you use. In my case, I have in the master file :

smtp      inet  n       -       y       -       1       postscreen

In the main.cf, I have :

postscreen_greet_action = enforce 
smtpd_milters = unix:/spamass/spamass.sock

So the mail is taken by postscreen, and if it pass it, go in spammassassin by using the milter.

jornane avatar
cn flag
I hadn't found `smtpd_milters`. That could be a good solution, because then I only need to override the submission service. I'll try this, thanks!
jornane avatar
cn flag
After trying a lot of different things, I found that the spamassassin socket is not the same as the spamass-milter socket. With that piece of information, setting up SpamAssassin was a breeze. Thank you :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.