Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run a web application on Amazon EC2 and, because of the shortcomings with AWS and reverse DNS, I direct email to a dedicated SMTP server running Postfix at a different provider.

Unfortunately the system adds the orginating EC2 info to the header, and some ISPs are blacklisting all EC2 IP ranges. Is there any way to have Postfix ignore or strip the EC2 information? I'm assuming this will help with deliverablity. I've included a sample header below. Thanks!

Received: from (localhost [])
    by (Postfix) with ESMTP id 7EB305
    for <>; Thu, 24 Sep 2009 16:11:37 +0000 (UTC)
Received: from ( [EC2 Static IP address])
    by (Postfix) with ESMTPSA id 56A865
    for <>; Thu, 24 Sep 2009 16:11:37 +0000 (UTC)
share|improve this question

A good way to do this is with postfix header_checks:

  1. Install or compile postfix-pcre to get Perl compatible regular expression evaluation into Postfix, if your postfix doesn't have it compiled in already.
  2. Add info

    header_checks = pcre:/etc/postfix/header_checks

  3. Add the following into /etc/postfix/header_checks:

    /^(Received: .*IP\.ADD\.RE\.SS.*)/ IGNORE

The IGNORE line will tell it to drop that line from the header of the email. I haven't tested this regex, so you might want to test with WARN. You can also use REPLACE, as seen here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.