Allow user to provide Amavis configuration (#299)

* Add the option of manually specifying paths to SSL certificates

* Adding tests for manual SSL changes

* Allow user provided configuration of amavis
This commit is contained in:
Morgan Kesler 2016-09-02 03:08:41 -04:00 committed by Thomas VIAL
parent 4e253a098d
commit 02f854f4e9
3 changed files with 31 additions and 1 deletions

View file

@ -397,6 +397,12 @@ fi
if ! [ "$DISABLE_CLAMAV" = 1 ]; then if ! [ "$DISABLE_CLAMAV" = 1 ]; then
/etc/init.d/clamav-daemon start /etc/init.d/clamav-daemon start
fi 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 if ! [ "$DISABLE_AMAVIS" = 1 ]; then
/etc/init.d/amavis start /etc/init.d/amavis start
fi fi

14
test/config/amavis.cf Normal file
View file

@ -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

View file

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