Re: [exim] Outbound IP Address

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Grant Peel
Date:  
À: exim-users
Sujet: 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/
>
>