Re: [Exim] Exim 4 feature request

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: John Jetmore
CC: exim-users
Temat: Re: [Exim] Exim 4 feature request
On Tue, 23 Oct 2001, John Jetmore wrote:

> On Tue, 23 Oct 2001, Philip Hazel wrote:
>
> > 2. Or do you mean "if MX exists for a domain, and points to one of
> > these hosts"? Have you spotted hosts_treat_as_local"?
>
> I meant this one.


For a small number of hosts, that test can be written like this

${if matches {${lookup dnsdb {mx=$domain}}}{host1|host2|host3...}{yes}{no}}

However, I can't see a convenient way of doing it for a list of hosts in
a file, because you may get several MX records returned.

Unless you are talking about the primary MX (i.e. the first one in the
MX list). If so, you could extract the host name from the first MX
returned by the dnsdb lookup using an "extract" or another regex.

In Exim 4 there is a convenient way of matching "any domain with an MX
pointing to this host", but not for "any domain with an MX pointing to
one of these hosts". hosts_treat_as_local doesn't help, because that is
a list of host names.

> Now for another question. spec.txt lists several times when
> hosts_treat_as_local has an affect, and I'm not familiar enough with all
> stages of exim's processing to know exactly what they mean.


I had to go and read the code, because I've forgotten! Basically, it's
used by the routers to check whether routing has ended up pointing "at
the local host". It is referenced after looking up a domain in the DNS,
or after looking up a host name (e.g. in a domainlist router).

Philip

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.