On Mon, 2007-01-01 at 22:19 +0100, Victor Gras wrote:
> 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.
why call it X-Received?
you should not remove Received headers, these are used to stop mail
loops. typically, when you reach 30 Received headers it will no longer
be forwarded, so the loop stops. but since you remove all of those
headers, the loop will continue forever.
> 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.
you'll get such a mail loop sooner or later, in the simplest case
joedoe@yourdomain will forward to jonathan.doe@otherdomain, then forget
about it and set up forwarding back to joedoe@yourdomain. that's all it
takes for your bandwidth and CPU to be gobbled up.
--
Kjetil T.