From 8d58e1565f661445d3d2db0f4b7870a3e78d7b36 Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:43:42 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> --- CHANGELOG.md | 12 +++++++++--- target/rspamd/local.d/actions.conf | 5 ++--- target/scripts/startup/check-stack.sh | 3 +-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a0a80a8..5f31e825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,15 +32,21 @@ The most noteworthy change of this release is the update of the container's base - DMS `main.cf` has renamed `postscreen_dnsbl_whitelist_threshold` to `postscreen_dnsbl_allowlist_threshold` as part of this change. - `smtpd_relay_restrictions` (relay policy) is now evaluated after `smtpd_recipient_restrictions` (spam policy). Previously it was evaluated before `smtpd_recipient_restrictions`. Mail to be relayed via DMS must now pass through the spam policy first. - The TLS fingerprint policy has changed the default from MD5 to SHA256 (_DMS does not modify this Postfix parameter, but may affect any user customizations that do_). -- **Environment variables**: - - `SA_SPAM_SUBJECT` has been renamed into `SPAM_SUBJECT` to incorporate Rspamd (for which the default settings changed, disabling the `rewrite_subject` action); a notification is logged when using the old `SA_SPAM_SUBJECT` and the value is copied as a fallback ([3820](https://github.com/docker-mailserver/docker-mailserver/pull/3820)) +- **Environment Variables**: + - `SA_SPAM_SUBJECT` has been renamed into `SPAM_SUBJECT` to become anti-spam service agnostic. ([3820](https://github.com/docker-mailserver/docker-mailserver/pull/3820)) + - As this functionality is now handled in Dovecot via a Sieve script instead of the respective anti-spam service during Postfix processing, this feature will only apply to mail stored in Dovecot. If you have relied on this feature in a different context, it will no longer be available. + - Rspamd previously handled this functionality via the `rewrite_subject` action which as now been disabled by default in favor of the new approach with `SPAM_SUBJECT`. + - `SA_SPAM_SUBJECT` is now deprecated and will log a warning if used. The value is copied as a fallback to `SPAM_SUBJECT`. + - The default has changed to not prepend any prefix to the subject unless configured to do so. If you relied on the implicit prefix, you will now need to provide one explicitly. + - `undef` was previously supported as an opt-out with `SA_SPAM_SUBJECT`. This is no longer valid, the equivalent opt-out value is now an empty value (_or rather the omission of this ENV being configured_). + - The feature to include [`_SCORE_` tag](https://spamassassin.apache.org/full/4.0.x/doc/Mail_SpamAssassin_Conf.html#rewrite_header-subject-from-to-STRING) in your value to be replaced by the associated spam score is no longer available. ### Updates - **Tests:** - Refactored helper methods for sending e-mails with specific `Message-ID` headers and the helpers for retrieving + filtering logs, which together help isolate logs relevant to specific mail when multiple mails have been processed within a single test. ([#3786](https://github.com/docker-mailserver/docker-mailserver/pull/3786)) - **Rspamd**: - - the `rewrite_subject` action, which was enabled by default, has been disabled; a Sieve script has been added in order to allow subject rewriting agnostic to the underlying anti-spam system ([3820](https://github.com/docker-mailserver/docker-mailserver/pull/3820)) + - The `rewrite_subject` action, is now disabled by default. It has been replaced with the new `SPAM_SUBJECT` environment variable, which implements the functionality via a Sieve script instead in favor of being anti-spam service agnostic ([3820](https://github.com/docker-mailserver/docker-mailserver/pull/3820)) ## [v13.3.1](https://github.com/docker-mailserver/docker-mailserver/releases/tag/v13.3.1) diff --git a/target/rspamd/local.d/actions.conf b/target/rspamd/local.d/actions.conf index 8d8dec1a..6ecb6d4b 100644 --- a/target/rspamd/local.d/actions.conf +++ b/target/rspamd/local.d/actions.conf @@ -8,9 +8,8 @@ greylist = 4; add_header = 6; reject = 11; -# The value `null` disabled the action. A subject rewrite is handled by -# SPAM_SUBJECT -# (https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/#spam_subject) +# The value `null` disabled the action. A subject rewrite is handled by `SPAM_SUBJECT`: +# https://docker-mailserver.github.io/docker-mailserver/latest/config/environment/#spam_subject # # The reasoning for this can be found in # https://github.com/docker-mailserver/docker-mailserver/issues/3804 diff --git a/target/scripts/startup/check-stack.sh b/target/scripts/startup/check-stack.sh index a650474d..cc98cfe2 100644 --- a/target/scripts/startup/check-stack.sh +++ b/target/scripts/startup/check-stack.sh @@ -55,8 +55,7 @@ function _check_log_level() { function _check_spam_prefix() { # This check should be independent of ENABLE_POP3 and ENABLE_IMAP - if _env_var_expect_zero_or_one MOVE_SPAM_TO_JUNK \ - && [[ ${MOVE_SPAM_TO_JUNK} -eq 0 ]] \ + if [[ ${MOVE_SPAM_TO_JUNK} -eq 0 ]] \ && [[ -z ${SPAM_SUBJECT} ]]; then _log 'warn' "'MOVE_SPAM_TO_JUNK=0' and 'SPAM_SUBJECT' is empty - make sure this is intended: spam e-mails might not be immediately recognizable in this configuration" fi