Fix the startup logic for sendmail. If sendmail_enable=yes, don't start

the submit and outbound daemon, else if sendmail_submit_enable=yes, don't
start the outbound daemon.  Only one daemon should be started.

Also, do not rebuild database maps at boot time.  The code didn't pay
attention to SENDMAIL_MAP_TYPE and assumed 'hash'.  Also, admins may
not want maps automatically rebuilt just because the back end database
has changed.  Finally, some maps are built with mode tools than just
makemap (e.g., using cidrexpand on the access text file before sending
it to makemap).

Noticed by:	ache
Reviewed by:	ache
This commit is contained in:
gshapiro 2004-08-05 03:09:54 +00:00
parent 206d41bcd8
commit e748eb242a

View File

@ -33,6 +33,17 @@ case ${sendmail_enable} in
;;
esac
# If sendmail_enable=yes, don't need submit or outbound daemon
if checkyesno sendmail_enable; then
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
fi
# If sendmail_submit_enable=yes, don't need outbound daemon
if checkyesno sendmail_submit_enable; then
sendmail_outbound_enable="NO"
fi
sendmail_precmd()
{
# Die if there's pre-8.10 custom configuration file. This check is
@ -58,16 +69,6 @@ sendmail_precmd()
"${name}: /etc/mail/aliases.db not present, generating"
/usr/bin/newaliases
fi
# check couple of common db files, too
for f in genericstable virtusertable domaintable mailertable; do
if [ -r "/etc/mail/$f" -a \
"/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
echo \
"${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
/usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f
fi
done
}
run_rc_command "$1"