From d1fb385c1010b1adf574d88e9c347dbbb4399a4a Mon Sep 17 00:00:00 2001 From: Gregory Neil Shapiro Date: Thu, 5 Aug 2004 03:09:54 +0000 Subject: [PATCH] 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 --- etc/rc.d/sendmail | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/etc/rc.d/sendmail b/etc/rc.d/sendmail index ccdb027409b..8b15a49ee3d 100755 --- a/etc/rc.d/sendmail +++ b/etc/rc.d/sendmail @@ -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"