Remove first 'Recieved' header with Postfix
I used to have problems with sending mail via my own Postfix install. The first hop for all my emails would originate from a dynamic IP:
Received: from [192.168.0.200] (203-59-192-211.dyn.iinet.net.au [203.59.192.211])
by mx.bluebottle.net.au (Postfix) with ESMTPSA id E3345C34170
for <user@domain.com>; Wed, 25 Jun 2008 22:45:41 +0800 (WST)
This caused problems with a few misconfigured SpamAssassin installs, which did RBL checks against every IP in the Received chain(!) and marked the message as being in the PBL or whatever. To work around this, I did the following:
/etc/postfix/main.cf:
header_checks = regexp:/etc/postfix/header_checks
/etc/postfix/header_checks:
/^Received:.*by\ mx.bluebottle.net.au\ \(Postfix\)\ with\ ESMTPSA/ IGNORE
This won't fire on incoming mail, because the 'A' in ESMTPSA stands for 'Authenticated', that is, the client used SMTP-AUTH to login before sending the mail.
This action totally drops the header, which has a number of consequences you should be aware of:
- bounce processing can be disrupted
- you lose any in-message records of the source of mail
If you don't mind the above problems, this is a nice method. If you want a more robust solution you can change the IGNORE action to a REPLACE, and write up a dummy 'Received' header entry.
Comment (0)Leave a Reply