You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Simon Matthews <si...@paxonet.com> on 2004/07/14 08:24:26 UTC

SpamAssassin on a Postfix relay? W/O Amavis

I would like to configure a mail relay (running Postfix) to run an initial 
SpamAssassin check. I want it to discard (or reject) emails that produce a 
high SA score. 

My intent is to discard many emails and then do a more detailed (with 
per-user bayes dbs) check on the final MTA. One of the reasons for wanting 
to run SA on the relay is that my MTAs also relay email to a sub-domain 
and I want to discard spams destined for the sub-domain. 

So, can anyone how to configure this? Without using Amavis, and 
configuring SA as a content_filter? 

Simon

Re: SpamAssassin on a Postfix relay? W/O Amavis

Posted by Paolo Cravero as2594 <pc...@as2594.net>.
Simon Matthews wrote:

> I would like to configure a mail relay (running Postfix) to run an initial 
> SpamAssassin check. I want it to discard (or reject) emails that produce a 
> high SA score. 

In postfix's master.cf modify as follows:

smtp      inet  n       -       n       -       70       smtpd  -o 
content_filter=filter

And then, lower (all on one line except for the comment):
# SpamAssassin
filter    unix  -       n       n       -       10      pipe 
user=spmfilter argv=/usr/local/spmfilter/filter.sh -f $(sender) -- 
$(recipient)

Please note that '70' here is the max number of parallel SMTP listeners 
and '10' is the number of max concurrent filters (thus spamc) run by 
Postfix. Adjust accordingly to your setup!

Then you write a filter.sh that handles all exceptions while calling 
spamc (or spamassassin itself if you're crazy enough :-)) and does what 
you want it to do.

On the Net there must already be something since our version with 
quarantine has been derived from there...

> So, can anyone how to configure this? Without using Amavis, and 
> configuring SA as a content_filter? 

No Amavis is needed here.

CAREFUL with file permissions!

Paolo

-- 
QRPp-I #707  + www.paolocravero.tk +  I QRP #476
   Beacon @ 28.3219 MHz + QRPp + QRSS3 + JN35TC