Users on a private network behind a NAT'ing firewall (fw.domain1.com)
have an occasional need to send mail to an smtp host (smtp.domain2.net)
for delivery to mailing lists, etc. Actually, corporate policy
precludes use of the name "domain1" in such messages. Therefore, a
solution is to use smtp.domain2.net as a relay for users in
domain1.com. (Please - I'm not here to debate the policy).
When I was asked to set this up, I thought masquerading was the answer.
However, masquerading has no (apparent) effect on the Received: header.
The example below shows headers sent from a host at 192.168.1.75 to
list...@listserver.somewhere.org:
< header # 2 >
Received: from smtp.domain2.net (ro...@smtp.domain2.net [A.B.C.D])
by listserver.somewhere.org (8.13.3/8.13.3) with ESMTP id
jAV5B8sC227318
for <list...@somewhere.org>; Tue, 22 Nov 2005 23:11:08 -0600
(CST)
< header # 1 >
Received: from [192.168.1.75] (fw.domain1.com [E.F.G.H])
by smtp.domain2.net (8.13.4/8.12.11) with ESMTP id jAV5B7N6018915
for <list...@somewhere.org>; Tue, 22 Nov 2005 23:11:07 -0600
(CST)
header #2 is fine of course, but header #1 presents the issue I'm
trying to overcome. I want to remove or actually re-write the
references to fw.domain.com, and its ip address E.F.G.H.
I understand that re-writing Received: headers is a somewhat
controversial subject, and can lead to all sorts of problems if it's
not done correctly. That's why I'm here - to learn how to do it
*correctly* :)
Here's the line from my .cf file that generated header #1
HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
My research so far has turned up three possible solutions:
1. An old hack to checkcompat (Bat book vol 2; O'Reilly's website)
2. Hack the .cf file to change the macros to fixed values
3. Use procmail
None of these are particularly appealing. What I'd much prefer is a
hack to the .mc file which could be maintained, and one which would
re-write *only* those messages from fw.domain.com [E.F.G.H] which are
being relayed. Can this be done... can the cat be skinned this way? Is
there a better way?
Thanks~
This is set with the M4 macro `confRECEIVED_HEADER'.
The standard defintion is:
define(`confRECEIVED_HEADER',`$?sfrom $s $.$?_($?s$|from $.$_)
$.$?{auth_type}(authenticated)
$.by $j ($v/$Z)$?r with $r$. id $i$?u
for $u; $|;
$.$b')
You could fake it with:
define(`confRECEIVED_HEADER',`from intrelay.domain2.net
by $j id $i; $b')
Or you could strip all host information with:
define(`confRECEIVED_HEADER',`id $i; $b')
which would only have a local queue ID and a date and time.
Hope this helps
RLH
> For info about our "Managing Internet Mail, Setting Up and Trouble <
> Shooting sendmail and DNS" and a schedule of dates and locations, <
> please send email to in...@harker.com, or visit www.harker.com <
Did I miss something?
Jay