Re: [exim] email archiving to file using router and transpor…

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Andrew Nelson
CC: exim-users
Subject: Re: [exim] email archiving to file using router and transport?
On Thu, 18 Nov 2004, Andrew Nelson wrote:

> This works:
> unseen save /var/mail/archive/$reply_address
>
> But this doesn't:
> unseen save /var/mail/archive/$domain (or $local_part)
>
> Why is that?


As the OP said, it's because there may be many recipients and the filter
runs only once.

> Also, is there a way I can switch between
> domainname_mail_in, domainname_mail_out depending
> on whether the domain is local or not?


Yes, provided you can write some kind of filter definition of what you
mean by "local". Typically the condition for outgoing mail is "comes
from a host on my LAN" (check $sender_host_address), but you can make it
what you like.

> If not - how do I
> access my MySQL database from the system filter?


Same as anywhere else; ${lookup mysql{some query}....} will work.

> Maybe it's best to parse it all to a perl script and do it
> manually?


Will be slower, but people do use Perl.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book