Re: [exim] Multiple relayhosts

Pàgina inicial
Delete this message
Reply to this message
Autor: Peter Bowyer
Data:  
A: exim-users
Assumpte: Re: [exim] Multiple relayhosts
Dirk grosse Osterhues said:
> Hi,
>
> didn't find anything about this issue and maybe it's not possible, but:
> is it possible to get a selection of relayhosts in subject to the
> senderaddress?
>
> To give an example:
> mail from user "foo" goes over relayhost1.tld,
> mail from user "bar" goes over relayhost2.tld
> ... and so on.
>
> Is there a way to get this running with exim? If not, does anybody know
> which mta ia able to do this?


You can use a lookup in the route_data directive in a manualroute router
to select what relay to use based on an arbitarily complex algorithm.

Lets' suppose you have a file with routing rules in it like this (to use
your example above)

foo: relayhost1.tld
bar: relaybost2.tld

The bare bones of a router might look like this:

relaybyuser:
driver = manualroute
domains = ! +local_domains
route_data = ${lookup {$sender_address_local_part} lsearch {/path/to/file}}

Check the docs for more information on manualroute - you might need extra
options. You can use various other expansion items if
sender_address_local_part isn't quite right for you.

http://www.exim.org/exim-html-4.40/doc/html/spec_20.html#IX1688

Peter