Re: [Exim] sub domains relays

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Andreas J Mueller
Dátum:  
Címzett: tlabs
CC: exim-users
Tárgy: Re: [Exim] sub domains relays
Hi tlabs!

> I have 88 sub domains to relay for a client.
> [...]
> Currently I am relaying like so:


> motherwell_foo_com:
> driver = manualroute
> domains = ! +local_domains
> route_list = motherwell.foo.com 81.137.72.166 byname
> transport = remote_smtp


That means 88 different routers for 88 domains... *cough*
Simplest solution: You can put more than one routing rule into
route_list:

  route_list = motherwell.foo.com 81.137.72.166 byname ; \
               glasgow.foo.com    81.137.72.167 byname ; \
               [...]
               aberdeen.foo.com   81.137.72.199 byname


That makes it only one router for all domains, but is hard to
maintain.

> Is there a way to do the routing without putting all 88 sub domians
> in routers individually with maybe some form of lookup. This could
> be file based or mysql as im using mysql for some stuff anyway.


This is for using file lookups. Replace route_list with

route_data = ${lookup{$domain}lsearch{/path/to/foo_com_domains}}

and create a file /path/to/foo_com_domains with the routing rules:

motherwell.foo.com: 81.137.72.166 byname
glasgow.foo.com:    81.137.72.167 byname
[...]


Or, even better, limit the router to only domains from this file:

domains = lsearch;/path/to/foo_com_domains
route_data = $domain_data

There is a subtle difference between these two when using no_more (see
chapter 19.7 in the Exim spec). Both should also work with MySQL
lookups.

Andy