« New VI Command | Main | New VI Command »

Add X-Originating-Ip Header in Postfix

I couldn't believe the lack of any helpful Google results for how to implement this, given that it seems to be fairly commonly accepted by other email hosts.

The idea is that you can specify the original sending IP of a piece of email your server is then forwarding elsewhere. Remote mail systems that support it *should* then pay attention to that IP rather than yours when it comes to spam reporting.

After a bit of tinkering, we came up with these two lines added to Postfix's header_checks.regexp file:

/^X-Originating-Ip:/i IGNORE
/^Received: from.*\[(.*)\].*by gate.*\.(?:emai|m)lsrvr\.com \(SMTP Server\) with/i PREPEND X-Originating-Ip: [$1]

The first line strips out any already-existing X-Originating-Ip line and the second adds a new one based on the last Received line in the message header. Obviously, for use on another mail system, the regex would need to be tailored to the naming scheme of the server being configured.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on June 14, 2007 11:14 PM.

The previous post in this blog was New VI Command.

The next post in this blog is New VI Command.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34