mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
This commit is contained in:
parent
49b62aa1be
commit
63cf0f9965
1
Makefile
1
Makefile
|
@ -123,6 +123,7 @@ fixtures:
|
||||||
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-catchall-local.txt"
|
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-catchall-local.txt"
|
||||||
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/sieve-spam-folder.txt"
|
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/sieve-spam-folder.txt"
|
||||||
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/non-existing-user.txt"
|
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/non-existing-user.txt"
|
||||||
|
docker exec mail_disabled_clamav /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-user.txt"
|
||||||
# Wait for mails to be analyzed
|
# Wait for mails to be analyzed
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
|
|
|
@ -744,6 +744,19 @@ function _setup_security_stack() {
|
||||||
SA_KILL=${SA_KILL:="6.31"} && sed -i -r 's/^\$sa_kill_level_deflt (.*);/\$sa_kill_level_deflt = '$SA_KILL';/g' /etc/amavis/conf.d/20-debian_defaults
|
SA_KILL=${SA_KILL:="6.31"} && sed -i -r 's/^\$sa_kill_level_deflt (.*);/\$sa_kill_level_deflt = '$SA_KILL';/g' /etc/amavis/conf.d/20-debian_defaults
|
||||||
test -e /tmp/docker-mailserver/spamassassin-rules.cf && cp /tmp/docker-mailserver/spamassassin-rules.cf /etc/spamassassin/
|
test -e /tmp/docker-mailserver/spamassassin-rules.cf && cp /tmp/docker-mailserver/spamassassin-rules.cf /etc/spamassassin/
|
||||||
|
|
||||||
|
if [ "$DISABLE_CLAMAV" = 1 ]; then
|
||||||
|
notify 'inf' "Disabling clamav"
|
||||||
|
cat > /etc/amavis/conf.d/50-user-security <<- EOM
|
||||||
|
use strict;
|
||||||
|
@bypass_virus_checks_maps = ();
|
||||||
|
$undecipherable_subject_tag = undef;
|
||||||
|
1;
|
||||||
|
EOM
|
||||||
|
else
|
||||||
|
notify 'inf' "Enabling clamav"
|
||||||
|
echo "" > /etc/amavis/conf.d/50-user-security
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$ENABLE_FAIL2BAN" = 1 ]; then
|
if [ "$ENABLE_FAIL2BAN" = 1 ]; then
|
||||||
notify 'inf' "Fail2ban enabled"
|
notify 'inf' "Fail2ban enabled"
|
||||||
test -e /tmp/docker-mailserver/fail2ban-jail.cf && cp /tmp/docker-mailserver/fail2ban-jail.cf /etc/fail2ban/jail.local
|
test -e /tmp/docker-mailserver/fail2ban-jail.cf && cp /tmp/docker-mailserver/fail2ban-jail.cf /etc/fail2ban/jail.local
|
||||||
|
|
|
@ -292,6 +292,25 @@
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# clamav
|
||||||
|
#
|
||||||
|
|
||||||
|
@test "checking clamav: should be listed in amavis when enabled" {
|
||||||
|
run docker exec mail grep -i 'Found secondary av scanner ClamAV-clamscan' /var/log/mail/mail.log
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "checking clamav: should not be listed in amavis when disabled" {
|
||||||
|
run docker exec mail_disabled_clamav grep -i 'Found secondary av scanner ClamAV-clamscan' /var/log/mail/mail.log
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "checking clamav: should not be called when disabled" {
|
||||||
|
run docker exec mail_disabled_clamav grep -i 'connect to /var/run/clamav/clamd.ctl failed' /var/log/mail/mail.log
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# opendkim
|
# opendkim
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue