Re: [exim] Change IP for different senders

Page principale
Supprimer ce message
Répondre à ce message
Auteur: technique@dreamhosting.fr
Date:  
À: exim-users
Sujet: Re: [exim] Change IP for different senders
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 :

email1=email1@???
email2=email2@???
email3=email3@???
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 :dreamhosting@???
Skype : admin@???
Tél : 0960538133
Fax : 0972127568

Le 16/02/2011 07:15, Phil Pennock a écrit :
> On 2011-02-15 at 21:26 +0100, technique@??? 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 user1@???, I want to use IP aaa.aaa.aaa.aaa
>> If message is sent by user2@???, 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:
>    user1@???:    aaa.aaa.aaa.aaa
>    user2@???:    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
>