Re: [exim] replace Received: from

Top Page
Delete this message
Reply to this message
Author: Victor Gras
Date:  
To: Giuliano Gavazzi, exim-users
Subject: Re: [exim] replace Received: from
Giuliano wrote:

> 1) what is the Received doing in the HELO string you are trying to
> match?
> 2) what is the /.../ doing? I might be wrong, but I think this is
> just the a RE delimiter as used by pcretest and in the pcre
> documentation and should not be used in this case.


yes... Finally I have resolved the issue in this way:

in the config gile I put this:

MYHEADER = "123456"



and in the smtp section this:

remote_smtp:
  driver = smtp 
  headers_remove = Received:X-Special-Header
  headers_add = ${if eq{$h_X-Special-Header:}{MYHEADER}\
                {X-Originating-IP: 123.12.12.12}\
                {X-Received: from $sender_rcvhost\n\t \
         from $sender_ident \
         (helo=$sender_helo_name)\n\t \
         by $primary_hostname \
         with $received_protocol \
         \n\t(Cipher $tls_cipher)\
         (PeerDN $tls_peerdn) \
         (Exim $version_number #$compile_number)\n\t \
         id ${message_id}\
         by authid <$authenticated_id>\
         with $sender_host_authenticated\
         \n\t for <$received_for> }}



In this way, only when a message contains the "X-Special-Header:
123456" those headers belonging to the User connection are removed.
Other way, a new X-Received header is generated containing the
original header of the message.

In this way, I can have control of messages who are allowed to do
this thing. It works and I don't observe problems in the Exim queue,
then to me this solution is enough.

Maybe it can be simplified in some way. I don't know!!.


happy new year,