diff --git a/target/postgrey/postgrey b/target/postgrey/postgrey index 30d6fa88..cd412e83 100644 --- a/target/postgrey/postgrey +++ b/target/postgrey/postgrey @@ -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" diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 7fc58059..7d4faaab 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -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 diff --git a/test/tests.bats b/test/tests.bats index 9e7a4f65..e166b77d 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -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"