Enable option to not run spamassassin
Setting the `DISABLE_SPAMASSASSIN=1` env var will start this container without spamassain.
This commit is contained in:
parent
3fd2f365a9
commit
60e5e42908
8
Makefile
8
Makefile
|
@ -54,6 +54,12 @@ run:
|
|||
-v "`pwd`/test":/tmp/docker-mailserver-test \
|
||||
-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)
|
||||
# Wait for containers to fully start
|
||||
sleep 20
|
||||
|
||||
|
@ -83,4 +89,4 @@ tests:
|
|||
|
||||
clean:
|
||||
# Remove running test containers
|
||||
docker rm -f mail mail_pop3 mail_smtponly mail_fail2ban fail-auth-mailer mail_disabled_amavis
|
||||
docker rm -f mail mail_pop3 mail_smtponly mail_fail2ban fail-auth-mailer mail_disabled_amavis mail_disabled_spamassassin
|
||||
|
|
|
@ -326,8 +326,10 @@ if [ -f /tmp/docker-mailserver/dovecot.cf ]; then
|
|||
fi
|
||||
|
||||
# Start services related to SMTP
|
||||
/etc/init.d/spamassassin start
|
||||
/etc/init.d/clamav-daemon start
|
||||
if ! [ "$DISABLE_SPAMASSASSIN" = 1 ]; then
|
||||
/etc/init.d/spamassassin start
|
||||
fi
|
||||
if ! [ "$DISABLE_AMAVIS" = 1 ]; then
|
||||
/etc/init.d/amavis start
|
||||
fi
|
||||
|
|
|
@ -42,6 +42,11 @@
|
|||
[ "$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 ]
|
||||
}
|
||||
|
||||
#
|
||||
# imap
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue