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

Góra strony
Delete this message
Reply to this message
Autor: Todd Lyons
Data:  
Dla: Phillip Carroll
CC: Exim Mailing List
Temat: Re: [exim] How to rewrite a local from id
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

--
The total budget at all receivers for solving senders' problems is $0.
If you want them to accept your mail and manage it the way you want,
send it the way the spec says to. --John Levine