From 3fbd2b3d0a5928f4526f8786af64ba726b720c25 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 11 Jul 2007 22:58:33 +0000 Subject: Drop postfix 1.x support. --- postfix/postfix.sh | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'postfix') diff --git a/postfix/postfix.sh b/postfix/postfix.sh index f60e2e2..4a40b4a 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -3,7 +3,7 @@ # /etc/local-COMMON/postfix/postfix.sh # Copyright 2002-2004 Jonas Smedegaard # -# $Id: postfix.sh,v 1.38 2007-07-11 22:51:52 jonas Exp $ +# $Id: postfix.sh,v 1.39 2007-07-11 22:58:33 jonas Exp $ # # Auto-tweak plain installed postfix Debian package # @@ -20,9 +20,9 @@ paramdirs='/etc/local/postfix /etc/local-ORG/postfix /etc/local-REDPILL/postfix confdir='/etc/postfix' postconf=/usr/sbin/postconf sp='[[:space:]]' -pf2= -if $postconf -d mail_version | grep -q '= 2'; then - pf2=1 +if ! $postconf -d mail_version | grep -q '= 2'; then + echo "ERROR: Your postfix is too old - this script requires at least postfix 2.0" + exit 1 fi pf22= if $postconf -d mail_version | grep -q '= 2\.2'; then @@ -110,18 +110,12 @@ $postconf -e 'smtpd_banner = $myhostname NO UCE ESMTP $mail_name (Debian/GNU)' #fi $postconf -e 'smtpd_helo_required = no' $postconf -e "`getlinesfromfile permit_mx_backup_networks`" -if [ "$pf2" ]; then - $postconf -e "maps_rbl_domains =" - $postconf -e "`getlinesfromfile smtpd_client_restrictions reject_rhsbl_client`" - $postconf -e "`getlinesfromfile smtpd_helo_restrictions`" - $postconf -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender`" - $postconf -e "`getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains`" - $postconf -e "`getlinesfromfile smtpd_data_restrictions`" -else - $postconf -e "`getlinesfromfile maps_rbl_domains`" - $postconf -e "`getlinesfromfile smtpd_helo_restrictions`" - $postconf -e "`getlinesfromfile smtpd_recipient_restrictions`" -fi +$postconf -e "maps_rbl_domains =" +$postconf -e "`getlinesfromfile smtpd_client_restrictions reject_rhsbl_client`" +$postconf -e "`getlinesfromfile smtpd_helo_restrictions`" +$postconf -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender`" +$postconf -e "`getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains`" +$postconf -e "`getlinesfromfile smtpd_data_restrictions`" # 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) @@ -197,13 +191,9 @@ else fi if [ -x /usr/sbin/amavisd ] || [ -x /usr/sbin/amavisd-new ]; then - localtransport="smtp" - if [ "$pf2" ]; then # lmtp is slightly buggy in earlier versions - localtransport="lmtp" # Provides multi-session mail transaction capability and per-recipient status responses. - $postconf -e 'max_use = 10' # Avoid too much reuse - fi + $postconf -e 'max_use = 10' # Avoid too much reuse cat $confdir/master.cf | egrep -q "^smtp-amavis$sp" || \ - echo "smtp-amavis unix - - n - 2 $localtransport -o smtp_data_done_timeout=1200s -o smtp_never_send_ehlo=yes -o disable_dns_lookups=yes" >> $confdir/master.cf + echo "smtp-amavis unix - - n - 2 lmtp -o smtp_data_done_timeout=1200s -o smtp_never_send_ehlo=yes -o disable_dns_lookups=yes" >> $confdir/master.cf cat $confdir/master.cf | egrep -q "^127.0.0.1:10025$sp" || \ echo '127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_helo_restrictions= -o smtpd_client_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes' >> $confdir/master.cf $postconf -e 'content_filter = smtp-amavis:[127.0.0.1]:10024' -- cgit v1.2.3