From cee6e116f5c1f415377dffc71342dc58c25f628d Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Sun, 23 Mar 2025 22:58:45 +0100 Subject: [PATCH] fix: GPG signing by adjusting `sender_header_filter.pcre` and related tests Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> --- target/postfix/sender_header_filter.pcre | 11 +++++------ .../set3/container_configuration/hostname.bats | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/postfix/sender_header_filter.pcre b/target/postfix/sender_header_filter.pcre index fe4ff045..dea712b5 100644 --- a/target/postfix/sender_header_filter.pcre +++ b/target/postfix/sender_header_filter.pcre @@ -1,11 +1,10 @@ -/^\s*Received:.*with ESMTPSA/ IGNORE +/^\s*Message-ID:/i PREPEND X-MS-Reactions: disallow +/^\s*Mime-Version: 1.0.*/i REPLACE MIME-Version: 1.0 +/^\s*Received: from.*127.0.0.1/ IGNORE /^\s*Received:.*amavisd-new/ IGNORE -/^\s*X-Originating-IP:/ IGNORE -/^\s*X-Mailer:/ IGNORE -/^\s*Mime-Version: 1.0.*/ REPLACE MIME-Version: 1.0 +/^\s*Received:.*with ESMTPSA/ IGNORE /^\s*User-Agent/ IGNORE /^\s*X-Enigmail/ IGNORE /^\s*X-Mailer/ IGNORE +/^\s*X-MS-Reactions/ IGNORE /^\s*X-Originating-IP/ IGNORE -/^\s*Received: from.*127.0.0.1/ IGNORE -/^Content-Type:/i PREPEND X-MS-Reactions: disallow diff --git a/test/tests/parallel/set3/container_configuration/hostname.bats b/test/tests/parallel/set3/container_configuration/hostname.bats index a525ecb2..65d7ce13 100644 --- a/test/tests/parallel/set3/container_configuration/hostname.bats +++ b/test/tests/parallel/set3/container_configuration/hostname.bats @@ -234,8 +234,9 @@ function _should_have_correct_mail_headers() { # but Amavis is changing that. It also changes protocol from SMTP to ESMTP. assert_line --index 7 --partial 'Received: from localhost (localhost [127.0.0.1])' assert_line --index 8 --partial "by ${EXPECTED_FQDN} (Postfix) with ESMTP id" - assert_line --index 14 --partial 'Message-Id:' - assert_line --index 14 --partial "@${EXPECTED_FQDN}>" + assert_line --index 14 'X-MS-Reactions: disallow' + assert_line --index 15 --partial 'Message-Id:' + assert_line --index 15 --partial "@${EXPECTED_FQDN}>" # Mail contents example: #