PREIN
/bin/sh
/usr/share/rpm-helper/add-user sendmail $1 mailnull /var/spool/mqueue /dev/null
/usr/share/rpm-helper/add-user sendmail $1 smmsp /var/spool/mqueue /dev/null
PREUN
/bin/sh
/usr/share/rpm-helper/del-service sendmail $1 sendmail
if [ $1 = 0 ]; then
update-alternatives --remove mta /usr/sbin/sendmail.sendmail
fi
POSTIN
/bin/sh
#
# Convert old format to new
#
if [ -f /etc/mail/deny ] ; then
cat /etc/mail/deny | \
awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
{print $1" REJECT"}' >> /etc/mail/access
cp /etc/mail/deny /etc/mail/deny.rpmorig
fi
for oldfile in relay_allow ip_allow name_allow ; do
if [ -f /etc/mail/$oldfile ] ; then
cat /etc/mail/$oldfile | \
awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
{ print \$1\" RELAY\" }" >> /etc/mail/access
cp /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
fi
done
#
# Set up the alternatives files for MTAs.
#
/usr/sbin/update-alternatives --install /usr/sbin/sendmail mta /usr/sbin/sendmail.sendmail 10 \
--slave /usr/lib/sendmail mta-in_libdir /usr/sbin/sendmail.sendmail \
--slave /usr/bin/mailq mta-mailq /usr/bin/mailq.sendmail \
--slave /usr/bin/newaliases mta-newaliases /usr/bin/newaliases.sendmail \
--slave /usr/bin/rmail mta-rmail /usr/bin/rmail.sendmail \
--slave /usr/share/man/man1/mailq.1.bz2 mta-mailqman /usr/share/man/man1/mailq.sendmail.1.bz2 \
--slave /usr/share/man/man1/newaliases.1.bz2 mta-newaliasesman /usr/share/man/man1/newaliases.sendmail.1.bz2 \
--slave /usr/share/man/man5/aliases.5.bz2 mta-aliasesman /usr/share/man/man5/aliases.sendmail.5.bz2 \
#--initscript sendmail
#
# Oops, these files moved
#
if [ -f /etc/sendmail.cf -a ! -f /etc/mail/sendmail.cf ] ; then
sed -e 's/^O AutoRebuildAliases/#O AutoRebuildAliases/' /etc/sendmail.cf > /etc/mail/sendmail.cf
mv /etc/sendmail.cf /etc/sendmail.cf.rpmorig
fi
if [ -f /etc/sendmail.cw ] ; then
cat /etc/sendmail.cw | \
awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
{ print $1 }' >> /etc/mail/local-host-names
cp /etc/sendmail.cw /etc/sendmail.cw.rpmorig
fi
#
# Rebuild maps (next reboot will rebuild also)
#
{ /usr/bin/newaliases
for map in virtusertable access domaintable mailertable
do
if [ -f /etc/mail/${map} ] ; then
/usr/sbin/makemap hash /etc/mail/${map} < /etc/mail/${map}
sleep 1
fi
done
} > /dev/null 2>&1
/usr/share/rpm-helper/add-service sendmail $1 sendmail
POSTUN
/bin/sh
if [ "$1" -ge "1" ]; then
${initdir}/sendmail condrestart > /dev/null 2>&1
fi
exit 0
/usr/share/rpm-helper/del-user sendmail $1 mailnull
/usr/share/rpm-helper/del-user sendmail $1 smmsp
Triggers
sendmail <
8.10.0
/bin/sh
/sbin/chkconfig --add sendmail