Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Problem Rewriting 'Received: from...' and 'From:...'

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


kagan at online

Nov 13, 2006, 6:58 AM

Post #1 of 4 (497 views)
Permalink
Problem Rewriting 'Received: from...' and 'From:...'

Hello,



the following question seems to be of interest for a lot of people, as I
found many similar questions in the net - but until now I couldn't find a
solution to the problem.



I want to change the senders identity completely - when user root sends an
email, addresses are rewritten - ok - but if you take a nearer look at the
mail, you'll find out very fast who's the real sender of the mail.



Here is an example:



Content of file /etc/email-addresses:



root: john.doe[at]mydomain.de



When typing :



echo "mycontent" | mail -s "mysubject" john[at]mydomain.de



at the prompt as user root local user 'john' receives the following mail:



Return-path: <john.doe[at]mydomain.de>

Envelope-to: john[at]mydomain.de

Delivery-date: Mon, 13 Nov 2006 14:31:52 +0100

Received: from root by mydomain.de with local (Exim 4.63)

(envelope-from <john.doe[at]mydomain.de>)

id 1Gjbuh-0002Xu-Gc

for john[at]mydomain.de; Mon, 13 Nov 2006 14:31:51 +0100

To: john[at]mydomain.de

Subject: mysubject

Message-Id: <E1Gjbuh-0002Xu-Gc[at]mydomain.de>

From: root <john.doe[at]mydomain.de>

Date: Mon, 13 Nov 2006 14:31:51 +0100



mycontent



In the exim.conf file I put the following rewriting-rule:



*@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\

{$value}fail}" Eh



MY QUESTIONS:



What can I do if I absolutely don't want to see the 'root' in the 'Received:
from ...' and 'From: ...' lines?



Or even more important - is the solution of this problem within the range of
possibilties of exim?



(System is Debian Sarge, Exim4)

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


mw at LF

Nov 15, 2006, 12:58 PM

Post #2 of 4 (452 views)
Permalink
Re: Problem Rewriting 'Received: from...' and 'From:...' [In reply to]

Hello,

On Mon, Nov 13, 2006 at 03:58:31PM +0100, Kunter Agan wrote:
> I want to change the senders identity completely - when user root sends an
> email, addresses are rewritten - ok - but if you take a nearer look at the
> mail, you'll find out very fast who's the real sender of the mail.
>
> Here is an example:
>
> Content of file /etc/email-addresses:
>
> root: john.doe[at]mydomain.de
>
> When typing :
>
> echo "mycontent" | mail -s "mysubject" john[at]mydomain.de
>
> at the prompt as user root local user 'john' receives the following mail:
>
> Return-path: <john.doe[at]mydomain.de>
> Envelope-to: john[at]mydomain.de
> Delivery-date: Mon, 13 Nov 2006 14:31:52 +0100
> Received: from root by mydomain.de with local (Exim 4.63)
> (envelope-from <john.doe[at]mydomain.de>)
> id 1Gjbuh-0002Xu-Gc
> for john[at]mydomain.de; Mon, 13 Nov 2006 14:31:51 +0100
> ...
>
>
> In the exim.conf file I put the following rewriting-rule:
>
> *@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\
> {$value}fail}" Eh
>
> MY QUESTIONS:
>
> What can I do if I absolutely don't want to see the 'root' in the 'Received:
> from ...' and 'From: ...' lines?

The problem is that 'root' is the value of $sender_ident and this
variable is not subject to address rewriting, it simply is no address.

You can get rid of the line by changing the Received: line Exim adds
to the message using the main option received_header_text. For details
see
http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch14.html#id2597806

> Or even more important - is the solution of this problem within the range of
> possibilties of exim?

Absolutely.

--
Gruss / Best regards | LF.net GmbH | fon +49 711 90074-411
Matthias Waffenschmidt | Ruppmannstr. 27 | fax +49 711 90074-33
mw[at]LF.net | D-70565 Stuttgart | http://www.lf.net

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


kagan at online

Nov 15, 2006, 1:58 PM

Post #3 of 4 (453 views)
Permalink
Re: Problem Rewriting 'Received: from...' and 'From:...' [In reply to]

Yeah, thank you. This is, what I found after posting my question - but there
is still remaining one 'superuser' - in the "From: root
<john.doe[at]mydomain.de>"-line.

When I found the 'received_header_text'-solution, I thought: Ok, no problem,
changing 'from_header_text' will solve the problem. But what a pity - there
is no 'from_header_text'-variable to alter...

So after thinking a while about it, I decided - ok, I am setting up a mail
server with virtual accounts - the problem really is more theoretical...

Maybe user root simply should not mail around...?

Greetings

kagan

-----Ursprüngliche Nachricht-----
Von: Matthias Waffenschmidt [mailto:mw[at]LF.net]
Gesendet: Mittwoch, 15. November 2006 21:59
An: Kunter Agan
Cc: exim-users[at]exim.org
Betreff: Re: [exim] Problem Rewriting 'Received: from...' and 'From:...'

Hello,

On Mon, Nov 13, 2006 at 03:58:31PM +0100, Kunter Agan wrote:
> I want to change the senders identity completely - when user root sends an
> email, addresses are rewritten - ok - but if you take a nearer look at the
> mail, you'll find out very fast who's the real sender of the mail.
>
> Here is an example:
>
> Content of file /etc/email-addresses:
>
> root: john.doe[at]mydomain.de
>
> When typing :
>
> echo "mycontent" | mail -s "mysubject" john[at]mydomain.de
>
> at the prompt as user root local user 'john' receives the following mail:
>
> Return-path: <john.doe[at]mydomain.de>
> Envelope-to: john[at]mydomain.de
> Delivery-date: Mon, 13 Nov 2006 14:31:52 +0100
> Received: from root by mydomain.de with local (Exim 4.63)
> (envelope-from <john.doe[at]mydomain.de>)
> id 1Gjbuh-0002Xu-Gc
> for john[at]mydomain.de; Mon, 13 Nov 2006 14:31:51 +0100
> ...
>
>
> In the exim.conf file I put the following rewriting-rule:
>
> *@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\
> {$value}fail}" Eh
>
> MY QUESTIONS:
>
> What can I do if I absolutely don't want to see the 'root' in the
'Received:
> from ...' and 'From: ...' lines?

The problem is that 'root' is the value of $sender_ident and this
variable is not subject to address rewriting, it simply is no address.

You can get rid of the line by changing the Received: line Exim adds
to the message using the main option received_header_text. For details
see
http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch14.html#id2597806

> Or even more important - is the solution of this problem within the range
of
> possibilties of exim?

Absolutely.

--
Gruss / Best regards | LF.net GmbH | fon +49 711 90074-411
Matthias Waffenschmidt | Ruppmannstr. 27 | fax +49 711 90074-33
mw[at]LF.net | D-70565 Stuttgart | http://www.lf.net


--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


mw at LF

Nov 16, 2006, 2:35 AM

Post #4 of 4 (451 views)
Permalink
Re: Problem Rewriting 'Received: from...' and 'From:...' [In reply to]

Hello,

On Wed, Nov 15, 2006 at 10:58:54PM +0100, Kunter Agan wrote:
> Yeah, thank you. This is, what I found after posting my question - but there
> is still remaining one 'superuser' - in the "From: root
> <john.doe[at]mydomain.de>"-line.
>
> When I found the 'received_header_text'-solution, I thought: Ok, no problem,
> changing 'from_header_text' will solve the problem. But what a pity - there
> is no 'from_header_text'-variable to alter...

You could of course provide a From: header in the first place, then
Exim would not have to add one (not sure if mail is capable of such
'advanced' features).

Or you could suppress the generation of the From: header (eventually
based on the condition who called exim) using the ACL modifier control
= suppress_local_fixups (see
http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch43.html#SECTthefrohea
and
http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#id2672936)

But of course this is an ugly hack and no clean solution that I would
recommend.

> So after thinking a while about it, I decided - ok, I am setting up a mail
> server with virtual accounts - the problem really is more theoretical...
>
> Maybe user root simply should not mail around...?

That's probably a good idea.

--
Gruss / Best regards | LF.net GmbH | fon +49 711 90074-411
Matthias Waffenschmidt | Ruppmannstr. 27 | fax +49 711 90074-33
mw[at]LF.net | D-70565 Stuttgart | http://www.lf.net

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.