Re: [exim] multiple hosts in route_data

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Bryan Rawlins
Date:  
À: exim-users
Sujet: Re: [exim] multiple hosts in route_data
I've had success with the following router and supporting config. If your MYSQL
fields contain multiple hosts, it will use them randomly, and I'm pretty sure it
goes through the whole list. One 'gotcha; is that you cannot have whitespace
between the hosts, eg it must be host1.example.com:host2.example.com.

The problem I've been having however is tha tif I use IP's instead of hostnames,
and a host in the primary router rejects it will not try the secondary. I
figure that's by design and ultimately the most sane approach, it just dosen't
work for my specific application. What I'm basically trying to do is re-invent
the wheel by having MX priority like flexibility but without using DNS, because
using DNS would mean maintaining a private proprietary copy of zones not
ultimetly under my control.

MYSQL_MAILHOST_QUERY    = SELECT Domain, PrimaryHostNames,\
            SecondaryHostNames  \
                        FROM ManualDomains \
                        WHERE Domain='${quote_mysql:$domain}' \
                        AND bActive='${quote_mysql:true}'


manual_primary:
        driver = manualroute
        domains = ${extract{Domain}{${lookup mysql {MYSQL_MAILHOST_QUERY}}}}
        hosts_randomize = true
        transport = remote_smtp
        host_find_failed = decline
        pass_on_timeout = true
        route_data = ${extract{PrimaryHostNames}{${lookup \
        mysql{MYSQL_MAILHOST_QUERY}}}}


manual_secondary:
        driver = manualroute
        domains = ${extract{Domain}{${lookup mysql {MYSQL_MAILHOST_QUERY}}}}
        hosts_randomize = true
        transport = remote_smtp
        host_find_failed = decline
        pass_on_timeout = true
        route_data = ${extract{SecondaryHostNames}{${lookup \
        mysql {MYSQL_MAILHOST_QUERY}}}}


bsd@??? wrote:
>
> Hi,
>
> we run a exim setup with mysql and use route_data in our send_to_gateway
> router. Is it possible to have more than one host in the database field?
> For example when one is not reachable / has no A record because of dns
> problems. I tried to add 2 in the database seperated with a : but exim
> always wants to use the first one.
>
> route_data = ${lookup mysql{select domain,routedata,quota from
> mail.domains where domain='$domain'}{${extract{routedata}{$value}}}}
>
> Thanks!
>
>


--
Bryan Rawlins
Network Administrator
OnlyMyEmail.com
(734) 780-2184
Bryan.Rawlins@???
http://www.onlymyemail.com