Re: [Exim] virtual-host routing question

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Mark Edwards
Datum:  
To: exim-users
Betreff: Re: [Exim] virtual-host routing question
On Tuesday, May 6, 2003, at 01:52 AM, Philip Hazel wrote:

> On Thu, 1 May 2003, Mark Edwards wrote:
>
>> I have the following router set up in exim 4.12 to route mail to
>> various virtual hosts:
>>
>> virtual:
>>    driver = redirect
>>    allow_fail
>>    allow_defer
>>    domains = lsearch;/usr/local/etc/mail/local_domains
>>    data =
>> ${lookup{$local_part}lsearch*{/usr/local/etc/mail/virtual/$domain}}
>>    file_transport = address_file
>>    pipe_transport = address_pipe
>>    no_more

>>
>> Works great. Is there a way to force exim to continue expanding
>> strings in the "alias" files, even if the string matches a local user?
>>
>> For instance, say mark is a local user, and I have the following in an
>> alias file:
>>
>> mark: mark,otheraddress@???
>> bubba:    mark

>>
>> In this case, mails addressed to mark go to both the local user mark
>> and the otheraddress@???, whereas mails to bubba only go
>> to
>> the local user mark. Is there a way to make it so that a alias that
>> resolves to a local user will continue to expand if that string is
>> also
>> an alias in the file?
>
> Normally, what you want should happen automatically, because new
> addresses are processed from the start. However, because you have a
> "domains" setting on your router, it will of course only pick up the
> new
> address if it is in one of those domains. Since you have not set
> qualify_preserve_domain on the router, the address "mark" will turn
> into
> mark@??? where x.y.z is the value of your qualify_domain setting. So,
> is that domain in your /usr/local/etc/mail/local_domains file?
>
> You can check out what is happening by
>
> exim -v -bt mark@???
>
> and get more information with -d, as always. Maybe
> qualify_preserve_domain is what you need?


That did it. The machine's hostname was being used as the domain name,
which caused subsequent passes to through the routers to ignore the
virtual router completely since it is triggered by domain name.
Actually, I'm realizing my aliases were quite broken because of this,
so I'm glad I've got it solved.

Have you considered including a good virtual-domain router in
configure.default? This is such a common function, and setting up a
virtual-domain router that works properly is non-trivial. I'm guessing
you don't do this because it would be hard to design a router that
works for everyone's needs. However, a good basic router with some
comments as to how customize would go a long way.

Thanks!

--
Mark Edwards
San Francisco, CA