From d9e1c0ad6152ad32fbe881d78169f7bc8ab90f39 Mon Sep 17 00:00:00 2001 From: Kai Ren Date: Tue, 6 Sep 2016 14:06:25 +0300 Subject: [PATCH] remove unnecessary spamd process (#312) --- Dockerfile | 4 ++-- Makefile | 8 +------- target/start-mailserver.sh | 3 --- test/tests.bats | 5 ----- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35d0e1e6..a410bedd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,8 +49,8 @@ RUN sed -i -e 's/#mail_plugins = \$mail_plugins/mail_plugins = \$mail_plugins si COPY target/dovecot/auth-passwdfile.inc /etc/dovecot/conf.d/ COPY target/dovecot/??-*.conf /etc/dovecot/conf.d/ -# Enables Spamassassin and CRON updates -RUN sed -i -r 's/^(CRON|ENABLED)=0/\1=1/g' /etc/default/spamassassin +# Enables Spamassassin CRON updates +RUN sed -i -r 's/^(CRON)=0/\1=1/g' /etc/default/spamassassin # Enables Amavis RUN sed -i -r 's/#(@| \\%)bypass/\1bypass/g' /etc/amavis/conf.d/15-content_filter_mode diff --git a/Makefile b/Makefile index 1ff5a64c..8a57f039 100644 --- a/Makefile +++ b/Makefile @@ -64,12 +64,6 @@ run: -e DISABLE_AMAVIS=1 \ -h mail.my-domain.com -t $(NAME) sleep 20 - docker run -d --name mail_disabled_spamassassin \ - -v "`pwd`/test/config":/tmp/docker-mailserver \ - -v "`pwd`/test":/tmp/docker-mailserver-test \ - -e DISABLE_SPAMASSASSIN=1 \ - -h mail.my-domain.com -t $(NAME) - sleep 20 docker run -d --name mail_disabled_clamav \ -v "`pwd`/test/config":/tmp/docker-mailserver \ -v "`pwd`/test":/tmp/docker-mailserver-test \ @@ -111,4 +105,4 @@ tests: clean: # Remove running test containers - docker rm -f mail mail_pop3 mail_smtponly mail_fail2ban mail_fetchmail fail-auth-mailer mail_disabled_amavis mail_disabled_spamassassin mail_disabled_clamav mail_manual_ssl + docker rm -f mail mail_pop3 mail_smtponly mail_fail2ban mail_fetchmail fail-auth-mailer mail_disabled_amavis mail_disabled_clamav mail_manual_ssl diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index fbf0fd62..89d27600 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -392,9 +392,6 @@ if [ "$ENABLE_FETCHMAIL" = 1 ]; then fi # Start services related to SMTP -if ! [ "$DISABLE_SPAMASSASSIN" = 1 ]; then - /etc/init.d/spamassassin start -fi if ! [ "$DISABLE_CLAMAV" = 1 ]; then /etc/init.d/clamav-daemon start fi diff --git a/test/tests.bats b/test/tests.bats index 8c928918..7b4832f3 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -52,11 +52,6 @@ [ "$status" -eq 1 ] } -@test "checking process: spamassassin (spamassassin disabled by DISABLE_SPAMASSASSIN)" { - run docker exec mail_disabled_spamassassin /bin/bash -c "ps aux --forest | grep -v grep | grep ''/usr/sbin/spamd'" - [ "$status" -eq 1 ] -} - @test "checking process: clamav (clamav disabled by DISABLE_CLAMAV)" { run docker exec mail_disabled_clamav /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/sbin/clamd'" [ "$status" -eq 1 ]