mailcow-dockerized-docs/docs/u_e-postfix-anonym_headers.md
xetorixik cbb0729392
Update Received header
/^\s*Received:[^\)]+\)\s+\(Authenticated sender:(.+)/ won't work as it does show the client's hostname + ip address with some mail clients.
For example Outlook 2016: "Received: from DESKTOPFREGERG5656 (hostname.provider.be [84.84.84.84]"
This is obviously not the intention.

Secondly, the replacement should be on 1 single line. 
The original header replacement parameter is on two lines and does not always work (tested).

This commit addresses the above problems.
2018-04-29 23:56:10 +02:00

670 B

To disguise your users details like IP, email client, etc. we have to create a new file in data/conf/postfix/mailcow_anonymize_headers.pcre and insert the following:

/^\s*Received:[^\n]*(.*)/         REPLACE Received: from localhost (localhost [127.0.0.1]) $1
/^\s*User-Agent/        IGNORE
/^\s*X-Enigmail/        IGNORE
/^\s*X-Mailer/          IGNORE
/^\s*X-Originating-IP/  IGNORE
/^\s*X-Forward/         IGNORE

Next we need to add the following to data/conf/postfix/main.cf:

smtp_header_checks = pcre:/opt/postfix/conf/mailcow_anonymize_headers.pcre

Then restart Postfix:

docker-compose restart postfix-mailcow