Re: [Exim] filter spam messages

Pàgina inicial
Delete this message
Reply to this message
Autor: Pat Lashley
Data:  
A: Quenten Griffith, exim-users
Assumpte: Re: [Exim] filter spam messages
--On Wednesday, January 07, 2004 11:56:50 -0800 Quenten Griffith <qgriffith22@???> wrote:

> Hello all I have exim4 running Cyrus IMAP,
> Spamassassian and Amavisd-New. I wanted to know what
> is the best way to filter any messages marked as spam
> to be deleviered via cyrus to each users spam folder.
> All the users are virtual. Is there a filter that can
> do this checking to see if the spam-flag is set to yes
> or should I use a router/transport that will check the
> condition of the spam-flag and then send it to a
> transport that delviers it to each persons Spam folder
> in their mailbox? What would the router/transport look
> like? Or should I use Sieve to do this?


The definition of 'best' is somewhat variable here; depending
primarily on how much handholding your users are likely to
require to customize a sieve filter.


I prefer to let the users do that sorting in their Sieve
scripts. That way they have much more choice in filtering
options via sieve at deliver time; or by their MUA if they
prefer to do it that way.

I use exiscan-acl and have the ACLs set to add the following
headers to every message:

    X-Spam-Score: $spam_score ($spam_bar)
    X-Spam-Score-Int: $spam_score_int
    X-Spam-Report: $spam_report


and if the score was over a system-wide threshold:

    X-Spam-Flag: YES


In sieve, it is quite easy to filter on the presence or
absence of the X-Spam-Flag header; and to check against
an integer level by doing a string match for the contents
of the $spam_bar. It should also be fairly easy to filter
on the presence of particular test names in the spam report.



If that's too technical for your users; then I'd probably
go for a rewrite rule that added '+spam' to the local part;
then let the normal Cyrus LMTP delivery handle it. (The
part after the plus should be the name of the spam folder.)
This gets slightly trickier if there is already a detail
part in the local part. (That's another policy issue that
I prefer to leave up to the individual user - if spam comes
addressed for direct delivery to a subfolder; should it go
to the spam mailbox or the folder?)





-Pat