r11: Preliminary etch package.
[amavisd-cn.git] / src / postfix.sh
index e851632..c89c30e 100644 (file)
@@ -1,77 +1,14 @@
 update_postfix() {
   # set up master.cf
   if [ -f /etc/postfix/master.cf ] && \
-     ! grep -q smtp-amavis /etc/postfix/master.cf; then
-    cp-update $PKG /etc/postfix/master.cf <<-EOF
-       smtp-amavis unix -  - n - 2  smtp
-           -o smtp_data_done_timeout=1200
-           -o disable_dns_lookups=yes
-           -o smtp_line_length_limit=0
-           -o notify_classes=protocol,resource,software
-           -o max_use=10
-       
-       127.0.0.1:10025 inet n  - n - -  smtpd
-           -o content_filter=
-           -o local_recipient_maps=
-           -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
-       EOF
+     \( ! grep -q smtp-amavis /etc/postfix/master.cf || \
+          dpkg --compare-versions "$2" lt $MASTTMPLVERSION \); then
+    noisy_backup /etc/postfix/master.cf
+    cp-update $PKG /etc/postfix/master.cf < $MASTTMPL
   fi
 
   # main.cf
   postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024"
-}
-
-conf_postfixize() {
-  local tmp
-  tmp=`basename $ACONF.dpkg-tmp.$$`
-  noisy_backup $ACONF
-  # detect non-postfix config
-  # XXX add $inet_socket_port & $inet_socket_bind
-  if egrep -q '^[[:blank:]]*\$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' $ACONF || \
-     ! ( egrep -q '^\$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' $ACONF && \
-         egrep -q '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' $ACONF && \
-         egrep -q '^\$inet_socket_port.*10024' $ACONF && \
-         egrep -q '^\$inet_socket_bind' $ACONF ); then
-    if catpatch $ACONF | patch -sfp0 --dry-run >&- 2>&-; then
-      oldpwd=`pwd`
-      cd `dirname $ACONF`
-      cp -p $ACONF $tmp
-      catpatch $tmp | patch -fp0
-      cp_mv $tmp $ACONF
-      cd $oldpwd
-      cp_echo -mailonly "CN: $ACONF patched for postfix."
-    # then try to update exact options without disturbing anything else
-    elif commented_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
-      '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
-      '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
-      -f $ACONF &&
-       uncommented_in_paragraph '^[[:blank:]]*#.*MILTER' \
-      '$forward_method = undef;[[:blank:]]*(#|$)' \
-      '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
-      -f $ACONF; then
-      cp $ACONF $tmp
-      uncomment_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
-        '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
-        '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
-        -f $tmp
-      comment_in_paragraph '^[[:blank:]]*#.*MILTER' \
-        '$forward_method = undef;[[:blank:]]*(#|$)' \
-        '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
-        -f $tmp
-      cp_mv $tmp $ACONF
-      cp_echo "CN: $ACONF updated for ${mta}."
-    # or just use the template
-    else
-      conf_from_template
-      cp_echo "CN: Config generated from ${ACONFTMPL}."
-    fi
-    restart_daemon=1
-    changed_config=1
-  fi
+  
   restart_mta=1
 }