3 if [ -f /etc/postfix/master.cf ] && \
4 ! grep -q smtp-amavis /etc/postfix/master.cf; then
5 cp-update $PKG /etc/postfix/master.cf <<-EOF
6 smtp-amavis unix - - n - 2 smtp
7 -o smtp_data_done_timeout=1200
8 -o disable_dns_lookups=yes
9 -o smtp_line_length_limit=0
10 -o notify_classes=protocol,resource,software
13 127.0.0.1:10025 inet n - n - - smtpd
15 -o local_recipient_maps=
16 -o smtpd_helo_restrictions=
17 -o smtpd_client_restrictions=
18 -o smtpd_sender_restrictions=
19 -o smtpd_recipient_restrictions=permit_mynetworks,reject
20 -o mynetworks=127.0.0.0/8
21 -o strict_rfc821_envelopes=yes
26 postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024"
31 tmp=`basename $ACONF.dpkg-tmp.$$`
33 # detect non-postfix config
34 # XXX add $inet_socket_port & $inet_socket_bind
35 if egrep -q '^[[:blank:]]*\$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' $ACONF || \
36 ! ( egrep -q '^\$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' $ACONF && \
37 egrep -q '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' $ACONF && \
38 egrep -q '^\$inet_socket_port.*10024' $ACONF && \
39 egrep -q '^\$inet_socket_bind' $ACONF ); then
40 if catpatch $ACONF | patch -sfp0 --dry-run >&- 2>&-; then
44 catpatch $tmp | patch -fp0
47 cp_echo -mailonly "CN: $ACONF patched for postfix."
48 # then try to update exact options without disturbing anything else
49 elif commented_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
50 '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
51 '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
53 uncommented_in_paragraph '^[[:blank:]]*#.*MILTER' \
54 '$forward_method = undef;[[:blank:]]*(#|$)' \
55 '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
58 uncomment_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
59 '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
60 '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
62 comment_in_paragraph '^[[:blank:]]*#.*MILTER' \
63 '$forward_method = undef;[[:blank:]]*(#|$)' \
64 '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
67 cp_echo "CN: $ACONF updated for ${mta}."
68 # or just use the template
71 cp_echo "CN: Config generated from ${ACONFTMPL}."