Re: [exim] Sending mail from different IP per domain

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Mike Cardwell
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Sending mail from different IP per domain
Wicus Ross wrote:

>>> I'm a novice when it regarding the running and configuring of Exim or
>>> Exim 4 for that matter. I'm running Ubuntu 6.10 Server.
>>>
>>> I have a machine that has 3 IP aliases on eth0. Each alias represents
>>> a website. One of the sites wish to send emails. I would prefer it if
>>> the email would originate from the IP address that is associated with
>>> that site.
>>>
>>> I have searched the forums and found atleast one post that relates to
>>> mine (http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20060918/msg00090.html).
>>>
>>> I tried to implement the suggested solution:
>>> http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20060918/msg00116.html.
>>> Unfortunately it doesn't seem to have the effect I'm hoping for or I'm
>>> at fault. My server identifies itself as the default host ie. what is
>>> stipulated in the hostname file.
>>>
>>> Is this possible or I'm on the wrong track?
>> You need to find your remote_smtp transport and set the "interface"
>> parameter on it. Eg:
>>
>> remote_smtp:
>>    driver    = smtp
>>    interface = ${if SOMECONDITION{ip1}{ip2}}

>>
>> If you start to get a lot more ips/domains, you might want to change the
>> conditional to be a file lookup.
>>
>> You might want to look into the "helo_data" configuration option also.
>>
> Thank you for the reply.


No problem. When replying, can you please comment inline, rather than
top posting.

> Its resolving to the last alias on the eth0 device.
>
> I ran the update-exim4.config.template and I restarted exim.
>
> transport/30_exim4-config_remote_smtp
>
> remote_smtp:
> debug_print = "T: remote_smtp for $local_part@$domain"
> driver = smtp
> interface = ${lookup{$host_address}lsearch*{/etc/exim4/interface}}
> helo_data = ${lookup{$host_address}lsearch*{/etc/exim4/helo_data}}
>
> /etc/exim4/interface:
> mydomain.com: eth0:1
>
> /etc/exim4/helo_data:
> mydomain.com: a.b.c.d


The problem is you're passing "eth0:1" to the interface option. The
interface option takes an IP address as an argument not an interface
name. I suppose that name is a little misleading come to think of it.

Mike