fixed postgrey inet parameter (#570)

* fixed postgrey inet parameter

* adapted test cases

	modified:   target/start-mailserver.sh
	modified:   test/tests.bats
This commit is contained in:
Thomas A. Kilian 2017-04-12 19:45:47 +02:00 committed by Thomas VIAL
parent ec6e5eea39
commit 7753d59d72
3 changed files with 3 additions and 3 deletions

View file

@ -2,5 +2,5 @@
# --delay=N how long to greylist, seconds (default: 300)
# --max-age=N delete old entries after N days (default: 35)
POSTGREY_OPTS="--inet=10023"
POSTGREY_OPTS="--inet=127.0.0.1:10023"

View file

@ -534,7 +534,7 @@ function _setup_ldap() {
function _setup_postgrey() {
notify 'inf' "Configuring postgrey"
sed -i -e 's/bl.spamcop.net$/bl.spamcop.net, check_policy_service inet:127.0.0.1:10023/' /etc/postfix/main.cf
sed -i -e "s/\"--inet=10023\"/\"--inet=10023 --delay=$POSTGREY_DELAY --max-age=$POSTGREY_MAX_AGE\"/" /etc/default/postgrey
sed -i -e "s/\"--inet=127.0.0.1:10023\"/\"--inet=127.0.0.1:10023 --delay=$POSTGREY_DELAY --max-age=$POSTGREY_MAX_AGE\"/" /etc/default/postgrey
TEXT_FOUND=`grep -i "POSTGREY_TEXT" /etc/default/postgrey | wc -l`
if [ $TEXT_FOUND -eq 0 ]; then

View file

@ -132,7 +132,7 @@ load 'test_helper/bats-assert/load'
}
@test "checking postgrey: /etc/default/postgrey correctly edited and has the default values" {
run docker exec mail_with_postgrey /bin/bash -c "grep '^POSTGREY_OPTS=\"--inet=10023 --delay=15 --max-age=35\"$' /etc/default/postgrey | wc -l"
run docker exec mail_with_postgrey /bin/bash -c "grep '^POSTGREY_OPTS=\"--inet=127.0.0.1:10023 --delay=15 --max-age=35\"$' /etc/default/postgrey | wc -l"
assert_success
assert_output 1
run docker exec mail_with_postgrey /bin/bash -c "grep '^POSTGREY_TEXT=\"Delayed by postgrey\"$' /etc/default/postgrey | wc -l"