mouss a écrit :
> Take a écrit :
>> Hello!
>>
>> I've been trying to figure out the best way to drop/sort spam with
>> virtual users. All documentation I could find didn't fit to our virtual
>> configuration and I'm a bit confused what's the best way to drop spam.
>>
>> Our setup is postfix+cyrus-imapd+spamassassin. Users have access to
>> sieve via roundcube plugin and we'd like to keep sieve out of this anyways.
>>
>> The goal is to apply an filter based on SA's score, so that if the score
>> is > 10 drop the mail and if it's less than 10 but still spam, deliver
>> it to user/myser/INBOX.Junk. The latter is optional step, main priority
>> is to drop "certain spam" (score over 10) so that user won't ever see it.
>>
> 
> your best option is to use amavisd-new, which has all the necessary
> functionality and more.
> 
> otherwise, if you are calling SA from a script, and then using the
> sendmail command to resubmit mail after filtering, then you can
> 
> - add an smtpd listener, say on port 10125 as well as an associated
> leanup service
> 
> - configure this cleanup service to use specific header_checks
> 
> - in these header checks, use something like:
> 
> /^X-Spam-Status: No, score=\d{2}/     HOLD
> 

I forgot:

- the smtpd listener should have "-o content_filter=" (to avoid passing
the mail to content filter again)

- configure sendmail to use the smtpd as a content_filter. do this by
adding a -o content_filter to the "pickup" service in master.cf


> HOLD will put the mail on hold, and you can then review it, discard it,
> inspect it, ... using postcat and postsuper.
> 
> PS. you could use DISCARD if you feel confident. if so, remember: it's
> your mail, not mine. if you lose mail, I won't even feel sorry I could,
> but I would be a liar) ;-p
> 
> 
>> [snip]
>>
>> Besides the actual goal I'm interested about the efficiency with each
>> method. I'd like to maintain lmtp-like delivery so that postfix doesn't
>> have to spawn processes for each and every mail going trough.
>>
> 
> with amavisd-new, you would have a daemon doing spamassassin (without
> forking a spamc process) and doing more (configurable delivery options,
> ... etc).

Reply via email to