Re: [exim] Outbound IP Address

Pàgina inicial
Delete this message
Reply to this message
Autor: Grant Peel
Data:  
A: exim-users
Assumpte: Re: [exim] Outbound IP Address
Hi Ted,

Here are the two new Routers and transports. I am still wrestling with how
to set the IP address as the outgoing interface for the alias
router/transport

Routers:

dnslookup_local:
#this router tests to be working as needed.
driver = dnslookup
domains = ! +local_domains
condition = ${lookup {$sender_address_domain} lsearch
{/etc/virtual/domains} {yes}{no}}
transport = remote_smtp_local
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

dnslookup_alias:
# if the 'To domain' is not local, and the above router was not used, use
this one
# as it appears the original 'To Address' was an alias that wilforward
mail to a
# non local smtp
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp_alias
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more


Transports:

remote_smtp_local:
        # This transport seems to be working well.
        driver = smtp
        helo_data = ${lookup 
dnsdb{defer_never,ptr=$sender_address_domain}{$value}{$primary_hostname
}}
        interface = ${lookup 
dnsdb{defer_never,a=$sender_address_domain}{$value}{69.90.69.141}}
        return_path_add = true
        debug_print = "XX T: remote_smtp for $local_part@$domain Sent VIA 
${lookup \
                        dnsdb{defer_never,a=$sender_address_domain} \
                        {$value}{69.90.69.141}} XX"
remote_smtp_alias:
        # This transport works, but how do I set the outgoing IP to the one
        # for the original domain (the aliases' domain, not the ultimate 
recipient.
        driver = smtp
        helo_data = ${lookup 
dnsdb{defer_never,ptr=$sender_address_domain}{$value}{$primary_hostname}}
#        interface = ${lookup 
dnsdb{defer_never,a=$sender_address_domain}{$value}{nnn.nnn.nnn.nnn}}
        return_path_add = true
        debug_print = "XX T: remote_smtp for $local_part@$domain Sent VIA 
${lookup \
                        dnsdb{defer_never,a=$sender_address_domain} \
                        {$value}{nnn.nnn.nnn.nnn}} XX"


-Grant



----- Original Message -----
From: "Grant Peel" <gpeel@???>
To: <exim-users@???>
Sent: Wednesday, April 30, 2008 5:11 PM
Subject: Re: [exim] Outbound IP Address


> Hi Ted,
>
> Thanks for the potential solution below, but I think you suggestion of
> adding another set of routers / transports is likely the simplest.
>
> I will see if I can forge a set and will post them here.
>
> -Grant
>
> ----- Original Message -----
> From: "Ted Cooper" <eximX1211@???>
> To: <exim-users@???>
> Sent: Wednesday, April 30, 2008 1:12 AM
> Subject: Re: [exim] Outbound IP Address
>
>
>> Grant Peel wrote:
>>> Hi all,
>>>
>>> I am toiling trying to set the outbound IP address (fo bandwidth
>>> accounting
>>> reasons), and have this so far:
>>>
>>> remote_smtp:
>>>         driver = smtp
>>>         helo_data = ${lookup
>>> dnsdb{defer_never,ptr=$sender_address_domain}{$value{$primary_hostname}}
>>>         interface = ${lookup
>>> dnsdb{defer_never,a=$sender_address_domain}{$value}{my.ip.host.here}}
>>>         return_path_add = true
>>>         debug_print = "XX T: remote_smtp for $local_part@$domain Sent 
>>> VIA
>>> ${lookup \
>>>                         dnsdb{defer_never,a=$sender_address_domain} \
>>>                         {$value}{my.host.ip.here}} XX"

>>>
>>> It seems to work ok if a virtual user logs in and sends an email to an
>>> outside server, it goes through OK and seemd to be reporting the right
>>> (outgoing) ip.
>>>
>>> However, if a mail comes into the server, addressed to an address that
>>> is
>>> an
>>> alias to another server (and domain), it fails miserably saying that
>>> 'can't
>>> assign requested address'. I am thinking that it is seeing the original
>>> sender's domain and trying to assing it as the outgoing address.
>>>
>>> Does anyone have any ideas here? ( or will I need to make another pair
>>> of
>>> remote_smtp Routers/Transports).
>>
>> It looks to me like the $sender_address_domain might be something you
>> are not dealing with when a message comes from outside into the server.
>> ie If hotmail.com is not in your dnsdb, then the result of the lookup
>> will be empty and cause an error.
>>
>> I would suspect separating out your router/transports would fix this
>> problem quite easily. A simple dnsdb lookup condition to see if should
>> be routing via that transport and a second to handle the case where it's
>> not one of your hosted domains.
>>
>> If you want to keep a single router/transport and have the string
>> expansions figure it all out for you then you're going to have to wrap
>> those lookups in an ${if and test to see if the result is empty or not.
>> On an empty lookup, provide a default value which will work for that
>> situation.
>>
>> Completely untested and unchecked:
>> ${if eq{lookup{this}}{}{default-value}{$value}}
>>
>> Since you probably wouldn't be actually doing anything with the sender
>> address, the pair of routers might be the way to go, even if one of them
>> has the no_verify option turned on.
>>
>> Ted.
>>
>> --
>> ## 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/
>>
>>
>
>
> --
> ## 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/
>
>