Re: [exim] single file lookup

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Sherman
Data:  
A: exim-users
Assumpte: Re: [exim] single file lookup
Jonathan Vanasco wrote:
>
> file: domain.com
> ----------------------
> a    : /usr/local/mail/domain.com/a
> b    : a@???
> ----------------------

>
> virtual_domains:
>   driver        = accept
>   transport     = virtual_domains__maildir_delivery
>   domains       = +local_domains
>   condition     =  
> ${lookup{$local_part}lsearch{/usr/local/etc/exim/virtual_domains/ $domain}}

>
> i thought about chaining a redirect router before this, but i swear i
> did this once before in 1 router.


Redirect is, in fact, the right approach. I don't use accept anywhere
in my config; all delivery is done with redirect:

virtual_domains:
   driver = redirect
   directory_transport = maildir_delivery
   domains = dsearch;/usr/local/etc/exim/virtual_domains
   data = ${lookup{$local_part}\
     lsearch{/usr/local/etc/exim/virtual_domains/$domain}}


From the looks of the router, your existing
virtual_domains__maildir_delivery transport does the lookup again to set
the directory option. Just remove that -- instead of being a specific
transport for looking up local parts in a domain file to deliver to, the
transport becomes a generic maildir deliverer, using whatever directory
the router told it to (which is why I dropped the prefix from the
transport name).

That's why I don't use accept any more -- redirect lets me put all the
routing logic where it belongs, in the router, and simplifies my
transports quite a bit -- the only transports I have defined are
remote_smtp, address_reply, local_maildir, local_maildir_read (same as
local_maildir, but it marks the message as already read, used for my
spam quarantine router).

- Marc