diff --git a/cmdeploy/src/cmdeploy/postfix/deployer.py b/cmdeploy/src/cmdeploy/postfix/deployer.py index c9079c9c..035bfbb5 100644 --- a/cmdeploy/src/cmdeploy/postfix/deployer.py +++ b/cmdeploy/src/cmdeploy/postfix/deployer.py @@ -52,6 +52,15 @@ class PostfixDeployer(Deployer): ) need_restart |= header_cleanup.changed + lmtp_header_cleanup = files.put( + src=get_resource("postfix/lmtp_header_cleanup"), + dest="/etc/postfix/lmtp_header_cleanup", + user="root", + group="root", + mode="644", + ) + need_restart |= lmtp_header_cleanup.changed + # Login map that 1:1 maps email address to login. login_map = files.put( src=get_resource("postfix/login_map"), diff --git a/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup b/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup new file mode 100644 index 00000000..d7389122 --- /dev/null +++ b/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup @@ -0,0 +1 @@ +/^DKIM-Signature:/ IGNORE diff --git a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 index 2a1867cf..8fee07f2 100644 --- a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 +++ b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 @@ -77,6 +77,7 @@ inet_protocols = all virtual_transport = lmtp:unix:private/dovecot-lmtp virtual_mailbox_domains = {{ config.mail_domain }} +lmtp_header_checks = regexp:/etc/postfix/lmtp_header_cleanup mua_client_restrictions = permit_sasl_authenticated, reject mua_sender_restrictions = reject_sender_login_mismatch, permit_sasl_authenticated, reject