Hi,
I have Linux/Debian/sendmail setup on the gateway for my internal network. Mails going out from internal to the Internet shows the following two Received: lines and I want to remove the internal IP on the second Received: line.
Received: from pen.ese.com (6-4-6-4.adsl.snet.net [6.4.6.4])
by atl4mhib39.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id r9OFixjT014615
for <test@gmail.com>; Thu, 24 Oct 2013 11:45:00 -0400
Received: from mac (mac [192.168.0.17])
by pen.ese.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r9OFYID7014798
for <test@gmail.com>; Thu, 24 Oct 2013 08:34:20 -0700
I found the Header Received: line in sendmail.cf, and I think that if somehow I can check the incoming mail IP, which is ${if_addr}, if equal to 192.168.0.x then just change the line to shows only the internal network number (192.168.0.x) instead of the full internal number. Can anyone have any idea on how to do this?
There is a way to call a rule set such as
HReceived: $>my_rule_set_1
Smy_rule_set_1
R ......
But I really don't know to do the conditional check. I imagine that there is something I can do such as:
if ${if_addr} = 192.168.0.17 then ${valid_send_addr} = 192.168.0.x
else ${valid_send_addr} = $_
And then the header line would be like:
HReceived: $?sfrom $s $.$?{valid_send_addr}($?s$|from $.d${valid_send_addr})
$.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
for $u; $|;
$.$b
Any idea?