Re: [exim] $sender_host_address

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Phillip Carroll
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] $sender_host_address
Ted,

Thanks for that explanation! I didn't catch that subtlety.

Given that the specific case I need to rewrite headers for is a set of
scripts that ultimately degenerate to Sendmail, the following turned out
be exactly what was needed:

  apache@* "${if eq {$sender_host_address}{} \
      {postmaster@$1} {fail} }"  Ffr


I added a separate rule for the sender header, using the "w" flag to
replace "Apache <apache@mydomain>" with a complete replacement.

I have one last header containing apache:

Received: from apache by ... yada yada

Any way I can change that to replace the user "apache" with the
rewritten part of the "Sender" header that precedes (or includes) the
angle bracketed part?


On 11/2/2014 5:33 PM, Ted Cooper wrote:
> On 03/11/14 10:14, Phillip Carroll wrote:
>> The chapter on variables says $Sender_host_address is null for local
>> host. If the message arrives from 0.0.0.0 $sender_host_address contains
>> 0.0.0.0. Likewise, 127.0.0.1, etc..
>
> Here's the documentation on that variable
>
>> $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.
>
> Notice that it says "locally submitted" and not "local host" as these
> are quite different things.
>
> Locally submitted means that exim has been called in "sendmail" mode on
> the command line with the email submitted on standard input. This is the
> case where $sender_host_address will be empty.
>
> In terms of networks, when any server connects over TCP it is considered
> a "remote host" and this is when the $sender_host_address will be filled
> the remote ip address of the TCP connection. That can be a server in
> China, or it can be a local website submitting to 127.0.0.1.
>
> The documentation could be adjust slightly to not mention "remote host"
> as while it is completely true, it is confusing if not familiar with TCP
> connections. "When a message is receive via a TCP connection ..." - I am
> not a wordsmith.
>
> Ted.
>
>