Exposing IP addresses of end users in email headers is bad for user privacy.

Here is how I have configured my installation of Postfix to rewrite "Received" headers as well as a number of other headers typically written by various email programs (MUA:s).

master.cf

submission inet n       -       n       -       -       smtpd
...
  -o cleanup_service_name=shutup
...
shutup    unix  n       -       n       -       0       cleanup
  -o syslog_name=postfix/shutup
  -o header_checks=pcre:$config_directory/shutup.pcre
...

shutup.pcre

/^\s*(Received: from)[^\n]*(.*by smtp\.adb-centralen\.se.*)/ REPLACE $1 adb-centralen.se (localhost [127.0.0.1])$2
/^\s*Mime-Version: 1\.0.*/ REPLACE Mime-Version: 1.0
/^\s*User-Agent/ IGNORE
/^\s*X-Enigmail/ IGNORE
/^\s*X-Mailer/ IGNORE
/^\s*X-Originating-IP/ IGNORE

Updates

2017-01-30

Rewriting Message-Id headers like below risks breaking email threading and was removed for a more conservative setup. This better be fixed in the MUA.

/^\s*(Message-Id:\s*<[^@]*).*>/ REPLACE $1@localhost>

Thanks to twitter:@_allo for pointing this out.