Added unit test for postfix master.cf overrides

This commit is contained in:
Mads R. Havmand 2017-06-09 12:45:08 +02:00
parent 2e4e65b705
commit 73f1e46796
4 changed files with 16 additions and 0 deletions

0
config/postfix-master.cf Normal file
View File

View File

@ -904,6 +904,16 @@ function _setup_postfix_override_configuration() {
else
notify 'inf' "No extra postfix settings loaded because optional '/tmp/docker-mailserver/postfix-main.cf' not provided."
fi
if [ -f /tmp/docker-mailserver/postfix-master.cf ]; then
while read line; do
if [[ "$line" =~ ^[a-z] ]]; then
postconf -P "$line"
fi
done < /tmp/docker-mailserver/postfix-master.cf
notify 'inf' "Loaded 'config/postfix-master.cf'"
else
notify 'inf' "No extra postfix settings loaded because optional '/tmp/docker-mailserver/postfix-master.cf' not provided."
fi
}
function _setup_postfix_sasl_password() {

View File

@ -0,0 +1 @@
submission/inet/smtpd_sasl_security_options=noanonymous

View File

@ -391,6 +391,11 @@ load 'test_helper/bats-assert/load'
assert_success
}
@test "checking postfix: master.cf overrides" {
run docker exec mail grep -q 'submission/inet/smtpd_sasl_security_options=noanonymous' /tmp/docker-mailserver/postfix-master.cf
assert_success
}
#
# dovecot
#