An issue came up on freebsd-stable today regarding the boot-time startup of
sendmail for users who are using other MTAs.  The end result was that users
needed a way to completely prevent sendmail from trying to start at boot
time.

The current order of operations at boot time is:

# MTA
if ${sendmail_enable} == YES
        start sendmail with ${sendmail_flags}
else
        if ${sendmail_outbound_enable} == YES
                start sendmail with ${sendmail_outbound_flags}
        if ${sendmail_submit_enable} == YES
                start sendmail with ${sendmail_submit_flags}
endif
# MSP Queue Runner
if [ -r /etc/mail/submit.cf] && ${sendmail_msp_queue_enable} == YES
        start sendmail with ${sendmail_msp_queue_flags}
endif

A few solutions were discussed and the patch represents what I feel to be
the best solution.  Instead of rc.conf's sendmail_enable only accepting YES
or NO, it can now also accept NONE.  If set to NONE, none of the other
sendmail related startup items will be done.  While creating the patch, I
found an extra queue running daemon might be started that wasn't necessary
(it didn't hurt anything but it wasn't needed).  That has been fixed in the
patch as well.

Therefore, the new order of operations (as shown in the rc.conf man page
and src/etc/defaults/rc.conf patches) is:

# MTA
if ${sendmail_enable} == NONE
        # Do nothing
else if ${sendmail_enable} == YES
        start sendmail with ${sendmail_flags}
else if ${sendmail_submit_enable} == YES
        start sendmail with ${sendmail_submit_flags}
else if ${sendmail_outbound_enable} == YES
        start sendmail with ${sendmail_outbound_flags}
endif
# MSP Queue Runner
if ${sendmail_enable} != NONE &&
   [ -r /etc/mail/submit.cf] && ${sendmail_msp_queue_enable} == YES
        start sendmail with ${sendmail_msp_queue_flags}
endif

This will allow users to set sendmail_enable to NONE in /etc/rc.conf and
completely avoid any sendmail daemons.

I've also updated the /etc/mail/Makefile "start" target code to match the
new order of operations and added a new set of targets for the MSP queue
runner (start-mspq, stop-mspq, and restart-mspq).

Unless I hear any good arguments against this change, I'll commit it in the
next day or two (and MFC it a week later).

The patches for the two branches are available at:

FreeBSD 4.5-STABLE:     http://people.freebsd.org/~gshapiro/smstart-STABLE
FreeBSD 5.0-CURRENT:    http://people.freebsd.org/~gshapiro/smstart-CURRENT

Thanks go to Thomas Quinot <[EMAIL PROTECTED]> and
Christopher Schulte <[EMAIL PROTECTED]> for their
contributions to the idea and Mark Santcroos <[EMAIL PROTECTED]> for reminding
me to update /etc/mail/Makefile with the new startup routines.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to