aboutsummaryrefslogtreecommitdiffstats
path: root/security/amavis-perl/pkg-deinstall.sendmail
blob: f24f7fd0431f35a1b9414f39ee3b77c6bc989e42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/security/amavis-perl/Attic/pkg-deinstall.sendmail,v 1.1 2001-10-21 18:47:20 dwcjr Exp $

prefix=/usr/local
PATH="/bin:/usr/bin"

if [ "$2" != "POST-DEINSTALL" ]; then
  exit 0
fi

if [ -f /etc/sendmail.cf.pre-amavis ]; then
  CFG=/etc
elif [ -f /etc/mail/sendmail.cf.pre-amavis ]; then
  CFG=/etc/mail
else
  echo "No sendmail.cf.pre-amavis found, are you sure that amavis was installed?"
  exit 1
fi
 
rm -f ${CFG}/sendmail.cf
rm -f ${CFG}/sendmail.orig.cf
mv ${CFG}/sendmail.cf.pre-amavis ${CFG}/sendmail.cf
sed /^virusalert/d ${CFG}/aliases > ${CFG}/aliases.tmp
mv ${CFG}/aliases.tmp ${CFG}/aliases
newaliases
rmdir /var/spool/mqamavis 2>/dev/null || echo "You may wish to inspect /var/spool/mqamavis directory by yourself and remove it"
rmdir /var/spool/quarantine 2>/dev/null || echo "You may wish to inspect /var/spool/quarantine directory by yourself and remove it"
exit 0