On 13/01/23 08:40, Viktor Dukhovni wrote:
On Thu, Jan 12, 2023 at 01:49:33PM -0500, post...@ptld.com wrote:

My solution...

main.cf:
      smtp_header_checks = pcre:/etc/postfix/header_checks_smtp


/etc/postfix/header_checks_smtp:
      /^Received:/           IGNORE
      /^X-Originating-Ip:/   IGNORE

That's a rather radical "solution".  More typically one would just drop
"Received" headers known to be added by the local MTA (matching the
hostnname in "by" clause explicitly).  As for "X-Originating-Ip:", if
you're the one not adding it, why remove it?  And if you are adding it,
then why, if only to remove it?

Perhaps:

/^(Received:.*)192\.168\.1\.2(.*)$/ REPLACE ${1}127.0.0.2${2}

Substitute your server's IP address for 192\.168\.1\.2 above, and it should replace that IP with 127.0.0.2 in any Received headers. Since you're explicitly telling it to only match and replace the exact IP address of your server the rest of the header should remain intact and troubleshooting should still be relatively easy. Note that I explicitly used 127.0.0.2 for the IP address to replace with since it's a legitimate loopback address, but it's easy to identify it as the one that got replaced because other references to the loopback address will be 127.0.0.1. Modify to suit.


Peter

Reply via email to