4 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -x
6 . /usr/share/carnet-tools/functions.sh
11 sendmail_cf=$MAILDIR/sendmail.cf
12 sendmail_mc=$MAILDIR/sendmail.mc
13 submit_mc=$MAILDIR/submit.mc
14 ct_file=$MAILDIR/trusted-users
15 main_cf=/etc/postfix/main.cf
16 master_cf=/etc/postfix/master.cf
19 egrep -v "^$1[[:blank:]]*=[[:blank:]]*" $main_cf > $main_cf.dpkg-tmp.$$
20 cp_mv $main_cf.dpkg-tmp.$$ $main_cf
23 if [ "$1" = remove ]; then
25 if grep -q $PKG $sendmail_mc $submit_mc 2>&- || \
26 grep -q '^amavis$' $ct_file 2>&- ; then
27 echo "Removing sendmail configuration for ${PKG}... "
28 cp-update -r -c dnl $PKG $sendmail_mc >&-
29 cp-update -r -c dnl $PKG $submit_mc >&-
30 grep -v '^amavis$' $ct_file > ${ct_file}.dpkg-tmp.$$ || true
31 cp_mv ${ct_file}.dpkg-tmp.$$ $ct_file
32 make -C /etc/mail 2>&1 | grep -v 'issue .*/etc/init.d/sendmail reload' 1>&2 || true
33 echo "Removed sendmail configuration for ${PKG}."
34 if pgrep -u root -f 'sendmail: MTA: accepting connections' >&- ; then
35 /etc/init.d/sendmail reload
36 if ! pgrep -u root -f 'sendmail: MTA: accepting connections' >&- ; then
37 echo 'CN: Something bad happened to sendmail on reload!' 1>&2
40 # Everything went well, apparently. Remove old backup files.
41 rm -f $sendmail_cf.$PKG
42 rm -f $sendmail_mc.$PKG
47 if grep -q $PKG $master_cf; then
48 cp-update -r $PKG $master_cf >&-
49 del_postconf content_filter
50 echo "Removed postfix configuration for ${PKG}."
51 if pgrep -u root -f /usr/lib/postfix/master >&- && \
52 [ -x /etc/init.d/postfix ] >&- ; then
53 /etc/init.d/postfix restart
56 cp-update -r $PKG $ALIASES >&-