Re: [exim] more than one smarthost with exim4

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: John Burnham
Dátum:  
Címzett: Lars Schimmer, exim-users@exim.org
Tárgy: Re: [exim] more than one smarthost with exim4
> I want to use 2 smarthosts instead of one. All mails with a special
> domain should be routed over smarthost 2, all other via smarthost 1.
> Now I do search for a best solution to include this.
> Should this be done best in transport?
>
> My (more or less default debian config) does send all mails to the
> smarthost transport, so I need to change the smarthost transport to
> include a if condition?
> Would this work fine?
>
> Anyone got a running setup with 2 or more smarthosts?
>

Are you using a manualroute router for your smarthost ? If so, this is documented in chapter 20 of the docs:

http://www.exim.org/exim-html-current/doc/html/spec_html/ch20.html

I can think of several ways:

1) Use domains = condition and have multiple manualroute routers which work for a different set of domains
2) Use a route_list = . The example given in the docs is

route_list = \
dict.ref.example mail-1.ref.example:mail-2.ref.example ; \
thes.ref.example mail-3.ref.example:mail-4.ref.example

which sends mail destined for dict.ref.example to either mail-1.ref.example or mail-2.ref.example and mail to thes.ref.example to either mail-3.ref.example or mail-4.ref.example. You can use * for wildcards.

3) Use route_data =. That allows you to do lookups. The example given in the docs is having a file containing:

dict.ref.example: mail-1.ref.example:mail-2.ref.example
thes.ref.example: mail-3.ref.example:mail-4.ref.example

and then using route_data = ${lookup{$domain}lsearch{/the/file/name}} in the router.

Basically, have a look at chapter 20 - the examples there are pretty good. If you have further questions then please post them back to the list.

For your example, I'd probably do something like
route_list = special_domain smarthost2; \
                         * smarthost


John