Checking configuration

This commit is contained in:
Thomas VIAL 2016-03-19 17:45:42 +01:00
parent 35085360d4
commit 8de15b6a57
8 changed files with 13 additions and 22 deletions

View File

@ -7,14 +7,10 @@ build:
docker build --no-cache -t $(NAME) .
run:
# Copy test files
cp test/accounts.cf postfix/
cp test/main.cf postfix/
cp test/virtual postfix/
# Run containers
docker run -d --name mail \
-v "`pwd`/postfix":/tmp/postfix \
-v "`pwd`/spamassassin":/tmp/spamassassin \
-v "`pwd`/test/postfix":/tmp/postfix \
-v "`pwd`/test/spamassassin":/tmp/spamassassin \
-v "`pwd`/test":/tmp/test \
-e SA_TAG=1.0 \
-e SA_TAG2=2.0 \
@ -22,14 +18,14 @@ run:
-e SASL_PASSWD=testing \
-h mail.my-domain.com -t $(NAME)
docker run -d --name mail_pop3 \
-v "`pwd`/postfix":/tmp/postfix \
-v "`pwd`/spamassassin":/tmp/spamassassin \
-v "`pwd`/test/postfix":/tmp/postfix \
-v "`pwd`/test/spamassassin":/tmp/spamassassin \
-v "`pwd`/test":/tmp/test \
-e ENABLE_POP3=1 \
-h mail.my-domain.com -t $(NAME)
docker run -d --name mail_smtponly \
-v "`pwd`/postfix":/tmp/postfix \
-v "`pwd`/spamassassin":/tmp/spamassassin \
-v "`pwd`/test/postfix":/tmp/postfix \
-v "`pwd`/test/spamassassin":/tmp/spamassassin \
-v "`pwd`/test":/tmp/test \
-e SMTP_ONLY=1 \
-h mail.my-domain.com -t $(NAME)
@ -45,14 +41,12 @@ fixtures:
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-user.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/non-existing-user.txt"
# Wait for mails to be analyzed
sleep 10
sleep 30
tests:
# Start tests
./test/bats/bats test/tests.bats
clean:
# Get default files back
git checkout postfix/accounts.cf postfix/main.cf postfix/virtual
# Remove running test containers
docker rm -f mail mail_pop3 mail_smtponly

View File

@ -1 +1,2 @@
user@domain.tld|mypassword
user1@localhost.localdomain|mypassword
user2@otherdomain.tld|mypassword

View File

@ -1,7 +1,2 @@
#
# ALIAS => from alias@domain.tld (alias) to user@domain.tld (real account), space separated
# alias@domain.tld user@domain.tld
#
# FORWARD => from redirect@domain.tld to a list of internal/external email addresses, space separated
# redirect@domain.tld otheruser@domain.tld otheruser@otherdomain.tld
#
alias1@localhost.localdomain user1@localhost.localdomain
alias2@localhost.localdomain external1@otherdomain.tld

View File

@ -263,8 +263,8 @@ if [ "$ENABLE_POP3" = 1 -a "$SMTP_ONLY" != 1 ]; then
/etc/init.d/courier-pop-ssl start
fi
/etc/init.d/spamassassin start
/etc/init.d/clamav-daemon start
/etc/init.d/spamassassin start
/etc/init.d/amavis start
/etc/init.d/opendkim start
/etc/init.d/opendmarc start

View File

@ -0,0 +1 @@
# Place you custom Spamassasin rules here