Autor: Wouter Verhelst Data: A: Johannes Nohl CC: exim-users Assumpte: Re: [exim] more than one smtp transport bounded to several
ipadresses
On Sat, Jan 26, 2008 at 09:44:20PM +0100, Johannes Nohl wrote: > Dear list,
>
> I'm using postfix right now but what I need isn't possible within
> postfix. To be correct it isn't possible as long as you run just one
> instance. I don't want to have more than one instance because I like
> to have one setup and one queue.
>
> Now I want to switch to exim. But is the following possible then?
>
> 1) Can I configure exim to have several smtp transports? Like mails
> with sender *@dom1.tld will be sent by smtp1, *@dom2.tld by smtp2...
Yes, no problem at all. Something like this:
smarthost:
driver = dnslookup
transport = ${lookup {$sender_address_domain}lsearch{/etc/exim/smarthosts}}
With that, you'd have to create a file /etc/exim/smarthosts like this:
dom1.tld: smtp1
dom2.tld: smtp2
Note that $sender_address_domain contains the domain in the envelope
from. If you want something else (e.g., the from header rather than the
envelope from), then you'd need to use some other expansion variable.
Please see the exim manual for a full list, under "Expansion variables".
> 2) Can I bind those different transports (smtp1, smtp2, ...) to
> different IPs? Like exim MTA is listening on all IPs. But to send it
> is using different IPs.
Yes, with the "interface" option of the "smtp" transport:
smtp1:
driver = smtp
interface = 192.168.1.1
Or whatever IP addresses you want to specify.
Note also that if this is the only reason you want to create separate
transports, that it is not necessary; rather than doing the lookup above
at router time, you could do it in the "interface" option of the smtp
router: