From ac795a5976503a67a376eba40b799a50c02f49d8 Mon Sep 17 00:00:00 2001 From: Casper Date: Sun, 16 Oct 2022 11:52:53 +0200 Subject: [PATCH] fix: run Amavis cron job only when Amavis is enabled (#2831) --- CHANGELOG.md | 1 + target/scripts/startup/setup-stack.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d253a45b..ee22ed1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. The format ### Fixed - **scripts**: Run `user-patches.sh` right before starting daemons ([#2817](https://github.com/docker-mailserver/docker-mailserver/pull/2817)) +- **scripts**: Run Amavis cron job only when Amavis is enabled ([#2831](https://github.com/docker-mailserver/docker-mailserver/pull/2831)) ## [11.2.0](https://github.com/docker-mailserver/docker-mailserver/releases/tag/v11.2.0) diff --git a/target/scripts/startup/setup-stack.sh b/target/scripts/startup/setup-stack.sh index 31a3e7e9..412f500b 100644 --- a/target/scripts/startup/setup-stack.sh +++ b/target/scripts/startup/setup-stack.sh @@ -79,6 +79,11 @@ function _setup_amavis else _log 'debug' "Removing Amavis from Postfix's configuration" sed -i 's|content_filter =.*|content_filter =|' /etc/postfix/main.cf + + _log 'debug' 'Disabling Amavis cron job' + mv /etc/cron.d/amavisd-new /etc/cron.d/amavisd-new.disabled + chmod 0 /etc/cron.d/amavisd-new.disabled + [[ ${ENABLE_CLAMAV} -eq 1 ]] && _log 'warn' 'ClamAV will not work when Amavis is disabled. Remove ENABLE_AMAVIS=0 from your configuration to fix it.' [[ ${ENABLE_SPAMASSASSIN} -eq 1 ]] && _log 'warn' 'Spamassassin will not work when Amavis is disabled. Remove ENABLE_AMAVIS=0 from your configuration to fix it.' fi