Re: [exim] moving spam to a different folder

Pàgina inicial
Delete this message
Reply to this message
Autor: John Robinson
Data:  
A: alexis
CC: Exim Users
Assumpte: Re: [exim] moving spam to a different folder
On 09/08/2007 00:56, alexis wrote:
> So what i want to to is to move out the marked spam to a different
> folder reachable by imap and leave the inbox that read's the pop3
> clients with the non marked email.
>
> Any help?


Certainly possible. I score spam in the data ACL, from which I end up
with $SPAM_REJECTERS set for users who think the message looks like
spam. So my transport looks like this:

local_delivery:
   driver = appendfile
   file = ${if match_local_part{$local_part}{$SPAM_REJECTERS} \
                 {${if exists{$home/mail/Junk} {$home/mail/Junk} \
                   {${if exists{$home/mail/Junk E-mail} {$home/mail/Junk 
E-mail} \
                     {var/spool/mail/$local_part}}}}} \
                 {/var/spool/mail/$local_part}}
   delivery_date_add
   envelope_to_add
   return_path_add


It only saves to the user's "Junk" or "Junk E-mail" folder if they
already have one. You'd probably want to change the initial test from
${if match_local_part etc. to something like ${if def:Spam-Header: etc.

NB. If you use the above, your /var/spool/mail needs to be `chmod o+wt`
and mode 666 (because the same router is delivering to both home
directories and /var/spool/mail).

Cheers,

John.