Skip to content

Instantly share code, notes, and snippets.

@milosdjakonovic
Last active March 18, 2019 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milosdjakonovic/a6bb6c8962b71b39795c77317bb6bd83 to your computer and use it in GitHub Desktop.
Save milosdjakonovic/a6bb6c8962b71b39795c77317bb6bd83 to your computer and use it in GitHub Desktop.
Strip some sensitive info from Postfix-sent emails

Received: from [192.168 Received: from localhost

nano /etc/postfix/header_checks

/^Received: from \[192\.168\..*$/   IGNORE
/^Received: from localhost .*$/     IGNORE
/^Received: from.*127\.0\.0\.1.*$/  IGNORE

or

/.*192\.168\..*/        IGNORE
/.*localhost.*/         IGNORE
/.*127\.0\.0\.1.*/      IGNORE

main.cf

header_checks = regexp:/etc/postfix/header_checks

No postmap command.

if not working, check & turn off no_header_body_checks where applied

and test

cat /etc/postfix/main.cf /etc/postfix/master.cf | grep 'no_header_body_checks'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment