From d99b8aaf6952170218bb8c3b73f0025d0fdf32b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Tue, 16 Oct 2018 10:26:41 +0200 Subject: [PATCH] [Postfix] Change mail_name to Postcow and only replace headers when mail_name matches --- data/conf/postfix/mailcow_anonymize_headers.pcre | 5 ++++- data/conf/postfix/main.cf | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/conf/postfix/mailcow_anonymize_headers.pcre b/data/conf/postfix/mailcow_anonymize_headers.pcre index 48cf4bdb..da303841 100644 --- a/data/conf/postfix/mailcow_anonymize_headers.pcre +++ b/data/conf/postfix/mailcow_anonymize_headers.pcre @@ -1,5 +1,8 @@ +if /^\s*Received:.*Authenticated sender.*\(Postcow\)/ /^\s*Received:.*Authenticated sender:(.+)/ - REPLACE Received: from localhost (localhost [127.0.0.1]) (Authenticated sender:$1 + REPLACE Received: from localhost (localhost [127.0.0.1]) (Authenticated sender:$1 +endif + /^\s*User-Agent/ IGNORE /^\s*X-Enigmail/ IGNORE /^\s*X-Mailer/ IGNORE diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf index dbb10cb8..fbcb3d5e 100644 --- a/data/conf/postfix/main.cf +++ b/data/conf/postfix/main.cf @@ -130,3 +130,4 @@ smtp_sasl_security_options = smtp_sasl_mechanism_filter = plain, login smtp_tls_policy_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_tls_policy_override_maps.cf smtp_header_checks = pcre:/opt/postfix/conf/mailcow_anonymize_headers.pcre +mail_name = Postcow