Re: [Exim] pull back lookup info as variable

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Dave Markham
Fecha:  
A: exim-users
Cc: exim-users
Asunto: Re: [Exim] pull back lookup info as variable
Thanks for the reply although I am not requiring to translate any ips.

I have looked at the dnsdb query and although i am not correct on the syntax
at all, in my own head im trying to do something like this in a dnslookup
router :-


#routers
ext_if_not_int:
driver = dnslookup
domains = ! +local_domains
transport = external_smtp
headers_remove = recieved
condition = ${lookup
dnsdb{mx=$domain}lsearch{/usr/exim/internal_ips}fail} <- this bit made up

int_if_not_ext:
driver = dnslookup
domains = ! +local_domains
transport = smtp


#transports

external_smtp:
driver = smtp
hosts = external.smart.host

smtp:
driver = smtp

I know the MX will return the name of the host for mx, but somewhere exim
does resolve it to know what ip to connection to. So i am trying to find
which ip it will try and connect to and if NOT an internal ip then send via
a smart host. If it is an internal ip then send via normal dnslookup using
our internal dns.


I have managed to get it all working with ignore_target_hosts on the router
set to be the internal ips, but from reading the book I dont think this is
the correct use of ignore_target_hosts

Any info would be appreciated

Thanks
Dave

> On Mon, 12 Jul 2004, Dave Markham wrote:
>
> > Does anyone know how to pull back the result of a lookup in a router
> > so you can run a condition based on the ip the lookup gets back??
>
> If you mean DNS lookup, see the "dnsdb" lookup type.
>
> > I need to lookup stuff based on domain name and depending on the MX ip
> > address it gets back i need the router to pass or fail so it can go to
> > transport or onto the next router. I am required to route mails to
> > different locations depending on the ip address of the MX record for
> > domains. I cannot determine and list all the domains see as they are
> > unknown, but the ip address range is known.
>
> MX records do not contain IP addresses. They contain host names. You
> would have to lookup up the MX records (plural) and then the hosts' A or
> AAAA records. This is not easy to do manually.
>
> There is another Exim feature that might help. Take a look at the
> translate_ip_address generic router option. At first sight, it looks as
> though it will do what you want.
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.
> Get the Exim 4 book:    http://www.uit.co.uk/exim-book

>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim

details at http://www.exim.org/ ##
>