Include whitelist_clients.local in postgrey setup from config folder (#564)

This commit is contained in:
Michael Als 2017-04-12 17:59:04 +02:00 committed by Thomas VIAL
parent 4536113a30
commit ec6e5eea39
4 changed files with 19 additions and 0 deletions

View file

@ -540,6 +540,7 @@ function _setup_postgrey() {
if [ $TEXT_FOUND -eq 0 ]; then if [ $TEXT_FOUND -eq 0 ]; then
printf "POSTGREY_TEXT=\"$POSTGREY_TEXT\"\n\n" >> /etc/default/postgrey printf "POSTGREY_TEXT=\"$POSTGREY_TEXT\"\n\n" >> /etc/default/postgrey
fi fi
cp -f /tmp/docker-mailserver/whitelist_clients.local /etc/postgrey/whitelist_clients.local
} }

View file

@ -0,0 +1 @@
whitelist.tld

View file

@ -0,0 +1,9 @@
request=smtpd_access_policy
protocol_state=RCPT
protocol_name=ESMTP
client_address=127.0.0.1
client_name=whitelist.tld
helo_name=whitelist.tld
sender=test@whitelist.tld
recipient=user1@localhost.localdomain

View file

@ -169,6 +169,14 @@ load 'test_helper/bats-assert/load'
assert_output 1 assert_output 1
} }
@test "checking postgrey: there should be a log entry about the whitelisted and passed e-mail user@whitelist.tld in /var/log/mail/mail.log" {
run docker exec mail_with_postgrey /bin/sh -c "nc 0.0.0.0 10023 < /tmp/docker-mailserver-test/nc_templates/postgrey_whitelist.txt"
sleep 8
run docker exec mail_with_postgrey /bin/sh -c "grep -i 'action=pass, reason=client whitelist' /var/log/mail/mail.log | wc -l"
assert_success
assert_output 1
}
# #
# imap # imap
# #