This file is indexed.

postrm is in courier-mta 0.78.0-2ubuntu2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/sh

set -e

del_override() {
    if dpkg-statoverride --list $4 >/dev/null; then
	dpkg-statoverride --force --remove $4
    fi
}

if [ "$1" = "remove" ]; then
    dpkg-divert --package courier-mta --remove --rename \
		--divert /usr/bin/addcr.ucspi-tcp /usr/bin/addcr
    dpkg-divert --package courier-mta --remove --rename \
		--divert /usr/share/man/man1/addcr.ucspi-tcp.1.gz /usr/share/man/man1/addcr.1.gz
fi

if [ "$1" = "purge" ]; then
    # Removes possibly automatically produced files
    for f in aliases.dat defaultdomain dsnfrom esmtpacceptmailfor.dat hosteddomains.dat locals smtpaccess.dat; do
	for ext in "" "~"; do
	    rm -f /etc/courier/$f$ext
	done
    done

    # Remove configuration directories if empty
    for dir in aliasdir aliases esmtpacceptmailfor.dir hosteddomains smtpaccess; do
	[ -d /etc/courier/$dir ] && rmdir --ignore-fail-on-non-empty /etc/courier/$dir
    done

    # Remove message queues
    rm -rf /var/lib/courier/msgq
    rm -rf /var/lib/courier/msgs

    # Remove generated TLS certificate
    rm -f /etc/courier/esmtpd.pem

    # Remove generated random file
    rm -f /etc/courier/esmtpd.rand
    rm -f /usr/lib/courier/esmtpd.rand

    # Delete Courier SMTP overrides
    del_override root courier 4755 /usr/sbin/rmail
    del_override courier courier 2755 /usr/bin/mailq
    del_override courier courier 6755 /usr/bin/cancelmsg
    del_override root courier 2755 /usr/sbin/sendmail
    del_override courier courier 4755 /usr/lib/courier/courier/submitmkdir

    for dir in allfilters filters msgq msgs track; do
	del_override courier courier 0750 /var/lib/courier/$dir
    done
    del_override courier courier 0770 /var/lib/courier/tmp

    del_override root courier 0750 /etc/courier/aliasdir
    del_override root courier 0750 /etc/courier/aliases
    del_override root courier 0640 /etc/courier/aliases/system
    del_override root courier 0640 /etc/courier/esmtpauthclient
    del_override root courier 0750 /etc/courier/filters
    del_override root courier 0750 /etc/courier/filters/active

fi

# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "purge" ] ; then
	update-rc.d courier-msa remove >/dev/null
fi


# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "purge" ] ; then
	update-rc.d courier-mta-ssl remove >/dev/null
fi


# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "purge" ] ; then
	update-rc.d courier-mta remove >/dev/null
fi


# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "purge" ] ; then
	update-rc.d courierfilter remove >/dev/null
fi


# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "purge" ] ; then
	update-rc.d courier remove >/dev/null
fi


# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/11.1.3ubuntu1
if [ "$1" = "remove" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper mask 'courier-mta.service' >/dev/null || true
	fi
fi

if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge 'courier-mta.service' >/dev/null || true
		deb-systemd-helper unmask 'courier-mta.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installdebconf/11.1.3ubuntu1
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section


exit 0