2 cp-update -c dnl $PKG $sendmail_mc <<-END
3 define(\`MILTER', 1)dnl
4 INPUT_MAIL_FILTER(\`amavis-milter', \`S=local:$AHOME/amavisd-new-milter.sock, F=T, T=S:10m;R:10m;E:10m')dnl
5 dnl Reducing number of messages in syslog for milter
6 define(\`confMILTER_LOG_LEVEL', \`4')dnl
8 #' XXX stupid joe syntax highlighing
11 # sendmail chunk moved out from postinst in 20030616p10-10
13 if [ -f $sendmail_mc ]; then
14 # creating backup files, just in case
15 cp -p $sendmail_mc $sendmail_mc.$PKG
17 cp -p $sendmail_cf $sendmail_cf.$PKG
20 if ! egrep -q '^INPUT_MAIL_FILTER.*amavis-milter' $sendmail_mc; then
23 elif grep -q 'Begin update by CARNet package amavisd-cn' $sendmail_mc; then
26 elif grep -q 'local:/var/run/amavis/amavis-milter.sock' $sendmail_mc; then
27 echo "CN: You seem to have a custom configuration for milter in"
28 echo " ${sendmail_mc}. I'll try to fix it but I don't promise anything."
29 echo " Things might break or behave unexpectedly."
30 cp_echo -mailonly "CN: Tried to fix custom milter config in ${sendmail_mc}."
31 cp_check_and_sed "/var/run/amavis/amavis-milter.sock" \
32 "s,/var/run/amavis/amavis-milter.sock,$AHOME/amavisd-new-milter.sock," \
38 # submit.mc: use /etc/mail/trusted-users, and add user amavis
39 # to get rid of Authentication-Warnings
40 if [ -f "$submit_mc" ]; then
41 cp -p $submit_mc $submit_mc.$PKG
43 if ! grep -q use_ct_file $submit_mc; then
44 cp-update -R --insert-before '^FEATURE\(`?msp' -c dnl $PKG $submit_mc <<-END
45 FEATURE(\`use_ct_file')dnl
47 grep -q '^amavis$' $ct_file || echo amavis >> $ct_file
48 echo "CN: Added FEATURE(use_ct_file) to $submit_mc."
52 if [ "$makecf" ]; then
53 make -C /etc/mail >/dev/null 2>&1
56 [ "$mcbak" ] && rm -f $sendmail_mc.$PKG
57 [ "$cfbak" ] && rm -f $sendmail_cf.$PKG
58 [ "$subak" ] && rm -f $submit_mc.$PKG
64 tmp=`basename $ACONF.dpkg-tmp.$$`
66 # are we configured for milter?
67 if ! egrep -q '^[[:blank:]]*\$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' $ACONF; then
68 # first try to apply patch
69 if catpatch $ACONF | patch -Rsfp0 --dry-run 2>&- ; then
73 catpatch $tmp | patch -Rfp0
76 cp_echo -mailonly "CN: $ACONF postfix patch removed."
77 # then try to update exact options without disturbing anything else
78 elif uncommented_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
79 '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
80 '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
82 commented_in_paragraph '^[[:blank:]]*#.*MILTER' \
83 '$forward_method = undef;[[:blank:]]*(#|$)' \
84 '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
87 comment_in_paragraph '^[[:blank:]]*#.*POSTFIX' \
88 '^$forward_method = '\''smtp:127.0.0.1:10025'\'';[[:blank:]]*(#|$)' \
89 '^\$notify_method = \$forward_method;[[:blank:]]*(#|$)' \
91 uncomment_in_paragraph '^[[:blank:]]*#.*MILTER' \
92 '$forward_method = undef;[[:blank:]]*(#|$)' \
93 '$notify_method = .*argv=/usr/sbin/sendmail -Ac.*-odd' \
96 cp_echo "CN: $ACONF updated for ${mta}."
100 cp_echo "CN: Config generated from ${ACONFTMPL}."