From 55cd01bac0e15d65b0d8cec7e987c921f7d6b81e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 22 Dec 2013 15:35:57 +0100 Subject: Fix only invoke postmap on sender_access_regex when file exists (i.e. when using DKIMproxy). --- postfix/postfix.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 3d40cc8..beed3af 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -238,19 +238,18 @@ $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_recipient_restrictions rejec $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_data_restrictions`" # FIXME: clear only specific line (not whole file) when dkimproxy unused -if [ -n "$dkimproxy" ]; then - [ -f "$tempdir/sender_access_regex" ] \ - && grep -q -F '/^/ FILTER dkimsign:[127.0.0.1]:10026' "$tempdir/sender_access_regex" \ +if [ -f "$tempdir/sender_access_regex" ]; then + if [ -n "$dkimproxy" ]; then + grep -q -F '/^/ FILTER dkimsign:[127.0.0.1]:10026' "$tempdir/sender_access_regex" \ || echo '/^/ FILTER dkimsign:[127.0.0.1]:10026' >> "$tempdir/sender_access_regex" -else - if [ -f "$tempdir/sender_access_regex" ]; then + else if grep -q -F '/^/ FILTER dkimsign:[127.0.0.1]:10026' "$tempdir/sender_access_regex"; then echo "echo '' > \"$confdir/sender_access_regex\"" >> "$tempdir/COMMANDS" rm "$tempdir/sender_access_regex" fi fi + postmapfiles="$postmapfiles sender_access_regex" fi -postmapfiles="$postmapfiles sender_access_regex" # Support exceptions to default response # (Day Old Bread (dob) lists need to reject only temporarily) -- cgit v1.2.3