Re: [exim] 1 user name in 2 different domains

Pàgina inicial
Delete this message
Reply to this message
Autor: Renaud Allard
Data:  
A: Jean-Paul BALOCHE
CC: exim-users
Assumpte: Re: [exim] 1 user name in 2 different domains
You should have on the machine handling the mail storage a router like
this one:

virtual_aliases:
        driver = redirect
        data = ${lookup{$local_part@$domain}lsearch{/etc/virtaliases}}
        file_transport  = address_file
        pipe_transport  = address_pipe


in your /etc/virtaliases, you should have something like this
toto@??? totostg
toto@??? totofrog

That means, if you wish a different mailbox for each mail account, the
user should also be different.

The virtual_aliases router justs redirects mail for toto@??? to
totostg mailbox (/home/totostg/Maildir/new in your case).

If you wish the same mailbox for the 2 domains, put something like this
in your virtaliases file:
toto2@???    toto2
toto2@???    toto2
I this case, both will go to /home/toto2/Maildir/new


Jean-Paul BALOCHE wrote:
> Hi,
>
> Thanks for your answer.
>
> for the moment, I have configured exim like this :
> [...]
> domainlist local_domains = stg.com:frog.com:localhost
> [...]
> smarthost_stg:
> driver = manualroute
> domains = +local_domains
> local_parts = lsearch;/etc/exim/valid_mailboxes_stg
> transport = remote_smtp
> route_list = "* 192.168.102.12"
>
> smarthost_frog:
> driver = manualroute
> domains = +local_domains
> local_parts = lsearch;/etc/exim/valid_mailboxes_frog
> transport = remote_smtp
> route_list = "* 192.168.102.12"
> ...
>
> So, if I replace smarthost_stg and smarthost_frog section by :
>
> data = ${lookup{$local_part@$domain}lsearch{/etc/aliases}}
>
> and if I configure /etc/aliases like this :
> toto1@???
> toto1@???
>
> is it ok ?
>
> What I don't understand is how it will work :
> if toto1@??? receives an e-mail, in which mailboxe will it goes ?
> /home/toto1/Maildir/new ?
> and how does it work for toto1@??? ? Will the mail goes in
> /home/toto1/Maildir/new directory ?
> What I want is to have 2 different directories (one for each domain)
>