Re: [exim] rewriting linux user in Received: header

Top Page
Delete this message
Reply to this message
Author: Renaud Allard
Date:  
To: Robert McNaught, exim-users
Subject: Re: [exim] rewriting linux user in Received: header
Hello,

On Wed, 11 Feb 2009 12:42:37 -0800 Robert McNaught <asteriskator@???>
wrote

> Hi,
>
> I am a newbie at exim, tried googling and doing rewrite rules to fix
> this, cant seem to figure this one out myself.
>
> I am having 2 "Received:" headers (the initial linux user then the IP
> of the exim server) appearing in the top of my email (I use evolution
> and click show all headers). One of them is showing the linux user
> which initiated the mail (this is a proprietary name and I wish to
> remove it or change it). I successfully managed to change the
> addresses in the envelope-from: and Return-path: headers using
> rewriting. However, I cannot see a fix for changing the linux user.
> I have a thought that it might be necessary to remove the headers
> called Received: from the mail completely, but I do not know if this
> makes it tough to get round spam blockers.
>
> Ideally, what I want to do is to change this line in the mail header:
>
> Received: from bob by myhost.mydomain.com with local (Exim
> 4.63)(envelope-from............
>
> Any idea how I can get rid of bob or change bob to sally?
>
> Rewrites only appear to work for real email addresses and not the
> linux user initiating the mail - I did try putting in
>
> bob sally EFTBcfhrst in exim.conf which I thought might have rewrote it.
>
> Can anyone point me in the right direction or tell me if its possible?
>


You shouln't rewrite or remove received headers, they are useful for loop
detection and things like that. However, you can define what is going to these
headers. But you can use this:
received_header_text = "Received: \
                ${if def:sender_fullhost {from ${sender_fullhost}\n\t}\
                ${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}\
                by ${primary_hostname} \
                ${if def:received_protocol {with ${received_protocol}}} \
                ${if def:tls_cipher {($tls_cipher)\n\t}}\
                ${if def:tls_peerdn {(tls_peerdn ${tls_peerdn})\n\t}}\
                id=${message_id}\
                ${if def:received_for {\n\tfor $received_for}}"


It does a great log in case of problems, but does not reveal too much internal
data.