Re: [Exim] Exim, virtual domains and selective filtering

Etusivu
Poista viesti
Vastaa
Lähettäjä: Stephen Gran
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [Exim] Exim, virtual domains and selective filtering
On Sat, Jul 24, 2004 at 05:12:02PM -0400, Kyle Downey said:
> I use Courier-IMAP and LDAP to provide virtual e-mail accounts: users
> do not have home directories; there is a
> /var/imap/${domain}/${user}/Maildir directory instead. I've gotten
> everything running, and recently added amavisd-new, ClamAV and
> SpamAssassin.
>
> What I'd like to do is provide a system-wide rule that will relay
> virus-infected messages and suspected spam to a particular Maildir for
> each user.
>
> Searching around I've found ways to do this with maildrop, procmail,
> other MTAs, etc., and ways for Exim that would work if there were a
> valid $home (like writing an Exim filter in .forward or a system filter
> that delivers to $home/Maildir/.Junk or the like). Unfortunately I
> haven't found anything on doing this with virtual domains, where the
> "home directory" is itself conditional on properties of the incoming
> message.


I'm not sure why this won't just work without a valid $home - the lines
below look fine for a system filter.

> What I'd like is somehow add a rule to my LDAP user transport that
> says "if there's an X-Spam-Status = YES or if the subject starts with
> VIRUS (is there a mail header for ClamAV+amavis I can use instead?)
> deliver to


warn  message = X-Virus: $malware_name
      demime = *
      malware = *


Will give you a ClamAV header. I would personally just 550 it, but if
you would prefer to deliver it, that should work.

> /var/imap/${lc:$domain}/${lc:$local_part}/Maildir/.Junk
>
> instead of
>
> /var/imap/${lc:$domain}/${lc:$local_part}/Maildir
>
> which is the regular place. What's the best tool in the exim4 kit for
> such a thing?


I think a system filter, or alternately an earlier router that has a
condition check for the headers. ISTR some problems in checking for
headers in routers, but I think that has been worked out now.

--
--------------------------------------------------------------------------
|  Stephen Gran                  | It is no wonder that people are so      |
|  steve@???             | horrible when they start life as        |
|  http://www.lobefin.net/~steve | children.   -- Kingsley Amis            |

--------------------------------------------------------------------------