Author: Chris Searle Date: To: Dave Evans CC: exim-users Subject: Re: [exim] Setting outgoing IP address for virtual hosts
On 26. nov. 2007, at 13.45, Dave Evans wrote:
>> What I would like to set up is that for all domains that I can
>> send/receive - use the IP address of the relevant domain's MX.
>>
>> For any that I only send as (the machine is also a webserver for some
>> domains for which it is not the MX - for these it sends mail for cron
>> jobs etc) - send as the machines main IP.
>>
>> Of note is that the MX records for the virtual domains are not
>> necessarily under the same domain name.
>
> I'm unclear as to the logic you want of how to know what IP address
> to use for
> each domain.
>
> Something like this (untested) should work:
>
> interface = ${lookup{$sender_address_domain}lsearch{/etc/exim4/
> interfaces} {$value}{88.198.38.80}}
>
> where /etc/exim4/interfaces lists domain-to-IP mappings like this:
>
> chrissearle.org: 78.47.168.125
> wegner.no: 78.47.168.122
>
> and 88.198.38.80 is your "default" IP address for domains not
> listed in that
> file (including any "bounce" messages you might happen to send).
Just thought I'd better say for the record (in case anyone else
googles this thread up in future) that this solution from Dave works
just as needed :) The interface line above although untested worked
out of the box. Many thanks :)