Skip to main content

How to Remove Sensitive Data from Postfix Headers ?

E-mail header contain some sensitive information. I’ll show you how to remove that information from the Postfix headers. note: some email clients will mark your email as spam if your header doesn’t contain an IP address. It is also very important to keep header details for your analysis. If any user started to spamming or compromised , then we must need header for analysis.
So we will remove only our client private network details.

We are assuming that postfix is already up and running and will make below changes.
Step:1 Edit ‘/etc/postfix/’ file
header_checks = regexp:/etc/postfix/header_checks
Step:2 Append the below line in ‘/etc/postfix/header_checks’ [at the bottom]
/^Received:/    IGNORE
Step:3 Run postmap to apply the new configuration in /etc/postfix/header_checks
[root@server1 ~]# postmap /etc/postfix/header_checks
Step:4 Restart or Reload the postfix server
[root@server1 ~]# systemctl restart postfix
[root@server1 ~]# postfix reload