Thanks Phil

One question to understand :

senders = lsearch;/path/to/data/ips_for_sender
address_data = $sender_data

 From where comes $sender_data




I have this in exim.conf
lookuphost:
   driver = dnslookup
   domains = ! +local_domains
   ignore_target_hosts = 127.0.0.0/8
   condition = "${perl{check_limits}}"
   transport = remote_smtp
   no_more

So I just add you lines before this to have this :

   dns_override_sendip:
     driver = dnslookup
     domains = !+local_domains
     senders = lsearch;/path/to/data/ips_for_sender
     address_data = $sender_data
     transport = remote_smtp_fromip

#Then define a transport:

   remote_smtp_fromip:
     driver = smtp
     interface = $address_data

    lookuphost:
       driver = dnslookup
       domains = ! +local_domains
       ignore_target_hosts = 127.0.0.0/8
       condition = "${perl{check_limits}}"
       transport = remote_smtp
       no_more



Now

I will have only some emails with specific IP.
Others are managed by domain IP.

So, to avoid to search in /path/to/data/ips_for_sender for all senders, 
I think it's better to add
specific email address and IP in exim.conf.

So, is it possible to use something like this :

[email protected]
[email protected]
[email protected]
ip1=1.1.1.1
ip2=2.2.2.2
ip3=3.3.3.3

And now, how to adapt your lines...

   dns_override_sendip:
     driver = dnslookup
     domains = !+local_domains
     senders = lsearch;/path/to/data/ips_for_sender
     address_data = $sender_data
     transport = remote_smtp_fromip


   remote_smtp_fromip:
     driver = smtp
     interface = $address_data


Sorry for question from a perfect beginner...

Regards

http://dreamhosting.fr, hébergeur discount.
http://dreamad.org, régie pub.
MSN :[email protected]
Skype : [email protected]
Tél : 0960538133
Fax : 0972127568

Le 16/02/2011 07:15, Phil Pennock a écrit :
> On 2011-02-15 at 21:26 +0100, [email protected] wrote:
>> Is it possible to send email from different IP, depending on email address ?
>>
>> Example :
>> I have a domain : domain.com
>>
>> If message is sent by [email protected], I want to use IP aaa.aaa.aaa.aaa
>> If message is sent by [email protected], I want to use IP aaa.aaa.aaa.bbb
>>
>> Is it possible ?
> Yes.
>
>> And how to do this ?
> Assume that you have a file /path/to/data/ips_for_sender:
>    [email protected]:  aaa.aaa.aaa.aaa
>    [email protected]:  aaa.aaa.aaa.bbb
>
> Before your normal "dnslookup" Router, have:
>
>    dns_override_sendip:
>      driver = dnslookup
>      domains = !+local_domains
>      senders = lsearch;/path/to/data/ips_for_sender
>      address_data = $sender_data
>      transport = remote_smtp_fromip
>
> Then define a transport:
>
>    remote_smtp_fromip:
>      driver = smtp
>      interface = $address_data
>
> So, the new Router checks the sender against a file, doing an "lsearch"
> lookup which checks for the key in the file.  The value from that file
> is temporarily in $sender_data; we save it away using the address_data
> option, which makes it available in $address_data in the Transport.
>
> The Transport option "interface" declares which IP address to use when
> sending.
>
> -Phil
> i
>
-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to