From 5dc52c17264374b76be6fd8d1e3d8b0ed5f28d3e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 14 Jan 2003 05:51:52 +0000 Subject: Use reject_rbl_client instead of deprecated reject_maps_rbl in postfix 2.x. --- postfix/postfix.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 874038c..e1cb635 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -3,7 +3,7 @@ # /etc/local-COMMON/postfix/postfix.sh # Copyright 2002 Jonas Smedegaard # -# $Id: postfix.sh,v 1.7 2003-01-04 02:46:14 jonas Exp $ +# $Id: postfix.sh,v 1.8 2003-01-14 05:51:52 jonas Exp $ # # Auto-tweak plain installed postfix Debian package # @@ -17,6 +17,10 @@ set -e paramdir='/etc/local-COMMON/postfix' confdir='/etc/postfix' sp='[[:space:]]' +pf2= +if postconf -d mail_version | grep -q '= 2'; then + pf2=1 +fi function getlinesfromfile() { param="$1" @@ -29,8 +33,19 @@ if /usr/sbin/postconf myhostname | grep '.' &> /dev/null; then /usr/sbin/postconf -e 'smtpd_helo_required = yes' fi /usr/sbin/postconf -e "`getlinesfromfile permit_mx_backup_networks`" -/usr/sbin/postconf -e "`getlinesfromfile maps_rbl_domains`" -/usr/sbin/postconf -e "`getlinesfromfile smtpd_recipient_restrictions`" +if [ "$pf2" ]; then + rbl_domains="`getlinesfromfile maps_rbl_domains | sed -e 's/.*=[ ]*//' -e 's/,/ /g'`" + rbl_domain_line= + for rbl_domain in $rbl_domains; do + rbl_domain_line="${rbl_domain_line}reject_rbl_client $rbl_domain," + done + recipient_restrictions="`getlinesfromfile smtpd_recipient_restrictions | sed 's/.*=[ ]*//' | sed \"s/reject_maps_rbl/$rbl_domain_line/\"`" + /usr/sbin/postconf -e "maps_rbl_domains =" + /usr/sbin/postconf -e "smtpd_recipient_restrictions = $recipient_restrictions" +else + /usr/sbin/postconf -e "`getlinesfromfile maps_rbl_domains`" + /usr/sbin/postconf -e "`getlinesfromfile smtpd_recipient_restrictions`" +fi # TLS breaks postfix if no SASL modules available (and doesn't make sense either) # (change the test if using some other modules and avoid the plain ones) -- cgit v1.2.3