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 2a80b4d0..8c928918 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -661,13 +661,23 @@ [ "$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 ] +} + # # setup.sh # # CLI interface @test "checking setup.sh: Without arguments: status 1, show help text" { - run ./setup.sh + run ./setup.sh [ "$status" -eq 1 ] [ "${lines[0]}" = "Usage: ./setup.sh [-i IMAGE_NAME] [-c CONTAINER_NAME] [args]" ] }