Re: [exim] virtual domains and aliases

Góra strony
Delete this message
Reply to this message
Autor: Peter Bowyer
Data:  
Dla: Exim-Users \(E-mail\)
Temat: Re: [exim] virtual domains and aliases
Erik Myllymaki <erik.myllymaki@???> wrote:
> to use separate aliases files for each domain that I accept mail for,
> could it be as easy as using /etc/aliases.domain1,
> /etc/aliases.domain2, etc. and then changing this part of exim.conf:
>
> system_aliases:
>    driver = redirect
>    allow_fail
>    allow_defer
>    data = ${lookup{$local_part}lsearch*{/etc/aliases}}
>    user = exim
>    file_transport = address_file
>    pipe_transport = address_pipe

>
> to this:
>
> system_aliases:
>    driver = redirect
>    allow_fail
>    allow_defer
>    data = ${lookup{$local_part}lsearch*{/etc/aliases.$domain}}
>    user = exim
>    file_transport = address_file
>    pipe_transport = address_pipe


Looks fine to me - Exim's flexibility strikes again :-)

A couple of observations:

- All pipe and file deliveries will happen under the 'exim' user - you
should be sure this is what you want

- You might want to have a domains= option on that router to make sure it
only fires on domains which you have an alias file for, otherwise strange
errors will happen when it tries to handle a domain which doesn't have a
file. You could automate this with a small change to your file layout and a
dsearch lookup:

 system_aliases:
    driver = redirect
    domains = dsearch;/etc/virtaliases
    allow_fail
    allow_defer
    data = ${lookup{$local_part}lsearch*{/etc/virtaliases/$domain}}
    user = exim
    file_transport = address_file
    pipe_transport = address_pipe


or like this:

 system_aliases:
    driver = redirect
    allow_fail
    allow_defer
    require_files = /etc/aliases.$domain
    data = ${lookup{$local_part}lsearch*{/etc/aliases.$domain}}
    user = exim
    file_transport = address_file
    pipe_transport = address_pipe


Either one will cause the router to pass if the file doesn't exist.

Peter