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
|
#!/bin/sh -e
# Debian smail postinst script
# (c) 1998 Soenke Lange soenke@escher.north.de
# Make sure there is a valid entry in /etc/inetd
if grep -q '^smtp' /etc/inetd.conf
then
echo "A valid emtp entry in /etc/inetd.conf found"
else
if grep -q '^# smtp' /etc/inetd.conf
then
cp /etc/inetd.conf /etc/smail/inetd.conf-$$
sed -e 's/^# smtp/#<off># smtp/' /etc/smail/inetd.conf-$$ > /etc/inetd.conf
rm -f /etc/smail/inetd.conf-$$
fi
# if grep -q -v smtp /etc/inetd.conf
# then
# echo "No valid entry in /etc/inetd.conf found."
# echo -n " Making one, "
# update-inetd --group OTHER --add "smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.smtpd"
# echo -n " and disable it."
# update-inetd --disable smtp
# echo " done."
# fi
fi
#install, run smailconfig on a not configured smail-system
# if I find something in /etc/smail/routers .. this is not the first inst of
# smail, so assuming it's configured
if [ -s /etc/smail/routers ]
then
echo Good. Smail is configured.
else
/usr/sbin/smailconfig || \
(echo "Can't execute smailconfig. Please run smailconfig manually."; exit 1)
fi
#upgrade
if grep -q " Debian Config Version 2" /etc/smail/config
then
echo "Good. You have a recent smail configuration"
else
# it seem to be an old smail installation
# so I only append some information at /etc/smail/config
# about all the new antispam/relay features of smail
zcat /usr/doc/smail/New-Config-Features.gz >> /etc/smail/config
echo "Please read the /usr/doc/smail/New-Config-Features carefully"
fi
# at least we have to restart smail ...
# if /etc/rc2.d/S??smail exist presume daemon mode
if [ -s /etc/rc2.d/S??smail ]
then
/etc/init.d/smail start
else
update-inetd --enable smtp
fi
|