diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index e9a80474..927af278 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -397,6 +397,12 @@ fi if ! [ "$DISABLE_CLAMAV" = 1 ]; then /etc/init.d/clamav-daemon start fi + +# Copy user provided configuration files if provided +if [ -f /tmp/docker-mailserver/amavis.cf ]; then + cp /tmp/docker-mailserver/amavis.cf /etc/amavis/conf.d/50-user +fi + if ! [ "$DISABLE_AMAVIS" = 1 ]; then /etc/init.d/amavis start fi diff --git a/test/config/amavis.cf b/test/config/amavis.cf new file mode 100644 index 00000000..09df670a --- /dev/null +++ b/test/config/amavis.cf @@ -0,0 +1,14 @@ +use strict; + +# +# Place your configuration directives here. They will override those in +# earlier files. +# +# See /usr/share/doc/amavisd-new/ for documentation and examples of +# the directives you can use in this file +# + +# Test Verification + +#------------ Do not modify anything below this line ------------- +1; # ensure a defined return diff --git a/test/tests.bats b/test/tests.bats index c929a362..13dd538f 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -660,3 +660,13 @@ run docker exec mail_pop3 /bin/sh -c "postconf | grep '^mynetworks =' | egrep '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}/32'" [ "$status" -eq 0 ] } + +# +# amavis +# + +@test "checking amavis: config overrides" { + run docker exec mail /bin/sh -c "grep 'Test Verification' /etc/amavis/conf.d/50-user | wc -l" + [ "$status" -eq 0 ] + [ "$output" -eq 1 ] +}