diff --git a/modoboa_installer/scripts/files/postfix/anonymize_headers.pcre.tpl b/modoboa_installer/scripts/files/postfix/anonymize_headers.pcre.tpl new file mode 100644 index 0000000..b4eef17 --- /dev/null +++ b/modoboa_installer/scripts/files/postfix/anonymize_headers.pcre.tpl @@ -0,0 +1,11 @@ +if /^\s*Received:.*Authenticated sender.*\(Postfix\)/ +/^Received: from .*? \([\w\-.]* \[.*?\]\)(.*|\n.*)\(Authenticated sender: (.+)\)\s+by.+\(Postfix\) with (.*)/ + REPLACE Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with $3 +endif +if /^\s*Received: from .*rspamd.localhost .*\(Postfix\)/ +/^Received: from.* (.*|\n.*)\((.+) (.+)\)\s+by (.+) \(Postfix\) with (.*)/ + REPLACE Received: from rspamd (rspamd $3) by $4 (Postfix) with $5 +endif +/^\s*X-Enigmail/ IGNORE +/^\s*X-Originating-IP/ IGNORE +/^\s*X-Forward/ IGNORE diff --git a/modoboa_installer/scripts/files/postfix/master.cf.tpl b/modoboa_installer/scripts/files/postfix/master.cf.tpl index 9f25b43..c35b4f4 100644 --- a/modoboa_installer/scripts/files/postfix/master.cf.tpl +++ b/modoboa_installer/scripts/files/postfix/master.cf.tpl @@ -27,6 +27,7 @@ submission inet n - - - - smtpd -o smtpd_helo_restrictions= -o smtpd_sender_restrictions=reject_sender_login_mismatch -o milter_macro_daemon_name=ORIGINATING + -o cleanup_service_name=ascleanup %{amavis_enabled} -o smtpd_proxy_filter=inet:[127.0.0.1]:10026 #smtps inet n - - - - smtpd # -o syslog_name=postfix/smtps @@ -42,6 +43,8 @@ submission inet n - - - - smtpd #628 inet n - - - - qmqpd pickup unix n - - 60 1 pickup cleanup unix n - - - 0 cleanup +ascleanup unix n - - - 0 cleanup + -o header_checks=pcre:/etc/postfix/anonymize_headers.pcre qmgr unix n - n 300 1 qmgr #qmgr unix n - n 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr diff --git a/modoboa_installer/scripts/postfix.py b/modoboa_installer/scripts/postfix.py index ea56b75..cf0c361 100644 --- a/modoboa_installer/scripts/postfix.py +++ b/modoboa_installer/scripts/postfix.py @@ -18,10 +18,9 @@ class Postfix(base.Installer): appname = "postfix" packages = { - "deb": ["postfix"], - "rpm": ["postfix"], + "deb": ["postfix", "postfix-pcre"], } - config_files = ["main.cf", "master.cf"] + config_files = ["main.cf", "master.cf", "anonymize_headers.pcre"] def get_packages(self): """Additional packages."""