Re: [exim] How to rewrite a local from id

Etusivu
Poista viesti
Vastaa
Lähettäjä: Phillip Carroll
Päiväys:  
Vastaanottaja: Todd Lyons
Kopio: Exim Mailing List
Aihe: Re: [exim] How to rewrite a local from id
Hi Todd,

Yes, Ted Cooper explained that to me earlier today on a similar thread I
started.
https://lists.exim.org/lurker/thread/20141103.110533.feb7fab8.en.html

On 11/3/2014 10:00 AM, Todd Lyons wrote:
> On Sun, Nov 2, 2014 at 3:00 PM, Phillip Carroll
> <postmaster@???> wrote:
>> I am now trying to narrow down my rewrite. I have tried the following,
>> based loosely on my reading of the doc section 31.11:
>>
>> apache@* "${if !eq {$sender_host_address} {} \
>>           {apache@$1} {postmaster@$1} }"  Ffrs

>>
>> I tested with:
>> exim -d -v -bh 127.0.0.1 -C my.test.conf -brw apache@mydomain
>>
>> Result: The indicated headers are rewritten back to the original apache!
>> Unless I am totally dense, 127.0.0.* is my local host. Hence, should not
>> $sender_host_address be null? I also tried -bh with my actual server IP,
>> with the same result.
>
> You are expecting $sender_host_address to be blank for SMTP
> connections from localhost. But when you are testing of
> $sender_host_address == "" (i.e. blank), you are checking to see if it
> was submitted locally, as in "cat file.eml | exim -t" or similar. It
> sounds like what you really want is to test if it comes from either
> 127.0.0.1 or if it's from a locally submitted process, and do the same
> rewrite for both.
>
> This is from the manual, chapter 11, definition of $sender_host_address:
>
> "When a message is received from a remote host, this variable contains
> that host’s IP address. For locally submitted messages, it is empty."
>
> ...Todd
>