3
# Debian post installation script
5
# Install of already installed package:
6
# 1) old-prerm upgrade new-version
7
# *) new-prerm failed-upgrade old-version
8
# *) old-postinst abort-upgrade new-version
10
# If a `conflicting' package is being removed at the same time:
11
# 1) forall packages depending on conflicting package and --auto-deconfigure
12
# deconfigured's-prerm deconfigure \
13
# in-favour package-being-installed version \
14
# removing conflicting-package version
15
# *) deconfigured's-postinst abort-deconfigure \
16
# in-favour package-being-installed-but-failed version \
17
# removing conflicting-package version
18
# 2) To prepare for removal of the conflicting package
19
# conflictor's-prerm remove \
20
# in-favour package new-version
21
# *) conflictor's-postinst abort-remove \
22
# in-favour package new-version
24
# Configuration of package:
25
# postinst configure most-recently-configured-version
29
PACKAGE=sendmail-base;
32
if [ -f /usr/share/debconf/confmodule ]; then
34
#. /usr/share/debconf/confmodule;
35
#db_stop; # For testing
42
#-----------------------------------------------------------
43
if [ "$2" = "" ]; then
46
#echo "A new sendmail user, welcome!";
49
#-----------------------------------------------------------
50
# Tell users about new and interesting things...
51
if [ -x /usr/share/sendmail/update_notices ]; then
52
/usr/share/sendmail/update_notices $2;
55
#-----------------------------------------------------------
56
# Create group/user smmta/smmsp iff needed
57
touch /etc/mail/tsmmta;
58
if ! chown root:smmta /etc/mail/tsmmta 2>/dev/null; then
59
addgroup --system --quiet smmta;
61
if ! chown smmta:smmta /etc/mail/tsmmta 2>/dev/null; then
62
adduser --system --ingroup smmta --home "/var/lib/sendmail" \
64
--quiet --gecos 'Mail Transfer Agent' smmta;
67
touch /etc/mail/tsmmsp;
68
if ! chown root:smmsp /etc/mail/tsmmsp 2>/dev/null; then
69
addgroup --system --quiet smmsp;
71
if ! chown smmsp:smmsp /etc/mail/tsmmsp 2>/dev/null; then
72
adduser --system --ingroup smmsp --home "/var/lib/sendmail" \
74
--quiet --gecos 'Mail Submission Program' smmsp;
78
#-----------------------------------------------------------
79
# With a dynamic uid/gid, have to set appropriate ownership herein
80
chown root:smmsp /etc/mail/sasl;
81
chown root:smmsp /etc/mail/tls;
83
#-----------------------------------------------------------
84
# Save the current configuration files in safe place...
85
if [ -x /etc/cron.daily/sendmail ]; then
86
echo "Saving current /etc/mail/sendmail.mc,cf to /var/backups";
87
/etc/cron.daily/sendmail || true;
90
#-----------------------------------------------------------
91
# Make sure inetd.conf has sendmail in it (but disabled)
92
if [ -x /usr/sbin/update-inetd ]; then
93
update-inetd --remove "^587";
94
update-inetd --group MAIL --add \
95
"smtp\tstream\ttcp\tnowait\troot\t/usr/sbin/sendmail sendmail -Am -bs";
96
update-inetd --group MAIL --add \
97
"submission\tstream\ttcp\tnowait\troot\t/usr/sbin/sendmail sendmail -Am -bs";
98
update-inetd --group MAIL --add \
99
"smtps\tstream\ttcp\tnowait\troot\t/usr/sbin/sendmail sendmail -Am -bs";
100
update-inetd --group MAIL --multi --disable smtp,smtps,submission;
105
abort-upgrade|abort-remove|abort-deconfigure)
110
echo "$PACKAGE postinst called with unknown argument \`$1'" >&2;