mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Include whitelist_clients.local in postgrey setup from config folder (#564)
This commit is contained in:
parent
4536113a30
commit
ec6e5eea39
|
@ -540,6 +540,7 @@ function _setup_postgrey() {
|
|||
if [ $TEXT_FOUND -eq 0 ]; then
|
||||
printf "POSTGREY_TEXT=\"$POSTGREY_TEXT\"\n\n" >> /etc/default/postgrey
|
||||
fi
|
||||
cp -f /tmp/docker-mailserver/whitelist_clients.local /etc/postgrey/whitelist_clients.local
|
||||
}
|
||||
|
||||
|
||||
|
|
1
test/config/whitelist_clients.local
Normal file
1
test/config/whitelist_clients.local
Normal file
|
@ -0,0 +1 @@
|
|||
whitelist.tld
|
9
test/nc_templates/postgrey_whitelist.txt
Normal file
9
test/nc_templates/postgrey_whitelist.txt
Normal 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
|
||||
|
|
@ -169,6 +169,14 @@ load 'test_helper/bats-assert/load'
|
|||
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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue