Remove or hide client sender IP from Postfix on SMTP relay

Sometimes we need to hide our IP address for security, if we use Cloudflare we need to create separate email server so our IP site origin will keep hidden.

The following is how to to remove client sender IP (X-Originating-IP) from Postfix generated email header and the only available data is IP from our email server.

Open /etc/postfix/master.cf and find:

cleanup   unix  n       -       n       -       0       cleanup

Add below those line and become:

cleanup   unix  n       -       n       -       0       cleanup
  -o header_checks=pcre:/etc/postfix/header_checks

Edit /etc/postfix/header_checks and add below codes:

/^Received:/ IGNORE

Now restart postfix. Let say on CentOS:

service postfix restart

Author: danpros

A self-proclaimed geek, business owner, and part-time blogger.

Comments on “Remove or hide client sender IP from Postfix on SMTP relay”