/dev/rob0 a écrit :
> On Sunday 04 October 2009 11:24:31 [email protected] wrote:
>> Another subject of consultation, I have implemented bogofilter in
>> my work, I have been trained according to the documentation at
>> this point that the messages marked as SPAM and HAM, the second
>> step would be to take a decision to the marked messages.
>>
>> How could move messages marked as spam that are coming, be moved
>> to a folder called SPAM on every mailbox?
>>
>> I use Postfix + MailScanner + Bogofilter + Dovecot
> 
> FWIW, I prefer the amavisd-new approach to this. The username (LHS of
> the email address) has "+spam" appended when reinjected. Then your
> ~/.forward+spam (for local(8) delivery, or user+s...@domain listings
> in $virtual_mailbox_maps for virtual(8)) controls where the spam is
> delivered.
> 

works too, but requires "some" care. in particular, if one has many
levels of virtual aliases (one can expand aliases before amavisd-new,
but I prefer passing the original address to the filter...).

for example, a virtual alias entry like:
        [email protected]        [email protected]
would apply to [email protected] (thus losing the +spam part) unless
he has a corresponding virtual alias.

> Offer void where taxed or prohibited by law or recipient_delimiter
> isn't set. And do give careful consideration to your choice of that,
> as has been discussed here recently. I wish I had chosen "-" rather
> than the traditional defacto default of "+" as shown in my example
> above. Underscore "_" or dot "." might also be good choices.
> 
> Mail routing should be done in the envelope, not by reading headers.

this isn't "standard" routing. it's classification based on the content.
the fact that amavisd-new hides it for you doesn't change that. in this
case, it's ok to use locally generated headers. Of course, OP needs to
make sure the header he uses is only generated by his filter. one way to
enforce this is to rewrite any such header at reception using header checks:
/^(X-Spam-\S*:.*)/      X-$1

this is so that even mail that is not passed through the filter is
guaranteed not to have such headers, and also to keep old headers (with
an X- prepended).

PS. I currently use both amavisd-new '+' and dovecot sieve.

Reply via email to