From 42504c14a8038bad59c8e89f92619e7154c922e1 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 23 Sep 2014 19:51:43 +0200 Subject: Fix suppress dkimproxy restriction when not used (and tidy loop while at it). --- postfix/postfix.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/postfix/postfix.sh b/postfix/postfix.sh index edf5d08..2860cdc 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -191,17 +191,20 @@ getlinesfromfile() { replacements= for subparam in $@; do case "$subparam" in + *=) + oldparam="`echo $subparam | awk -F= '{print $1}'`" + replacements="$replacements;s/$oldparam[^,]*,\?//" + continue + ;; *=*=*) oldparam="`echo $subparam | awk -F= '{print $1}'`" newparam="`echo $subparam | awk -F= '{print $2}'`" newparamfile="`echo $subparam | awk -F= '{print $3}'`" - shift ;; *) oldparam=$subparam newparam=$subparam newparamfile=$subparam - shift ;; esac newparamvalues="`getlinesfromfile $newparamfile | sed -e 's/.*=[ ]*//' -e 's/,/ /g'`" @@ -245,7 +248,7 @@ $postconf -c "$tempdir" -e "`getlinesfromfile permit_mx_backup_networks`" $postconf -c "$tempdir" -e "maps_rbl_domains =" $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_client_restrictions reject_rhsbl_client`" $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_helo_restrictions`" -$postconf -c "$tempdir" -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender`" +$postconf -c "$tempdir" -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender ${dkimproxy:-check_sender_access=}`" $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains`" $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_data_restrictions`" -- cgit v1.2.3