Provide a way for users to completely prevent sendmail from trying to start
at boot time. 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. Remove an extra queue running daemon might be started that wasn't necessary (it didn't hurt anything but it wasn't needed). The new logic 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 Discussed with: Thomas Quinot <Thomas.Quinot@Cuivre.FR.EU.ORG>, Christopher Schulte <schulte+freebsd@nospam.schulte.org> MFC after: 1 week
This commit is contained in:
parent
77dfe39221
commit
4bfef13db0
@ -335,16 +335,17 @@ lpd_program="/usr/sbin/lpd" # path to lpd, if you want a different one.
|
||||
lpd_flags="" # Flags to lpd (if enabled).
|
||||
usbd_enable="NO" # Run the usbd daemon.
|
||||
usbd_flags="" # Flags to usbd (if enabled).
|
||||
sendmail_enable="NO" # Run the sendmail inbound daemon (YES/NO).
|
||||
sendmail_enable="NO" # Run the sendmail inbound daemon (YES/NO/NONE).
|
||||
# If NONE, don't start any sendmail processes.
|
||||
sendmail_flags="-L sm-mta -bd -q30m" # Flags to sendmail (as a server)
|
||||
sendmail_submit_enable="YES" # Start a localhost-only MTA for mail submission
|
||||
sendmail_submit_flags="-L sm-mta -bd -q30m -ODaemonPortOptions=Addr=localhost"
|
||||
# Flags for localhost-only MTA
|
||||
sendmail_outbound_enable="YES" # Dequeue stuck mail (YES/NO).
|
||||
sendmail_outbound_flags="-L sm-queue -q30m" # Flags to sendmail (outbound only)
|
||||
sendmail_msp_queue_enable="YES" # Dequeue stuck clientmqueue mail (YES/NO).
|
||||
sendmail_msp_queue_flags="-L sm-msp-queue -Ac -q30m"
|
||||
# Dequeue stuck clientmqueue mail (YES/NO).
|
||||
sendmail_submit_enable="YES" # Start a localhost-only MTA for mail submission
|
||||
sendmail_submit_flags="-L sm-mta-submit -bd -q30m -ODaemonPortOptions=Addr=localhost"
|
||||
# Flags for localhost-only MTA
|
||||
# Flags for sendmail_msp_queue daemon.
|
||||
dumpdev="NO" # Device name to crashdump to (or NO).
|
||||
dumpdir="/var/crash" # Directory where crash dumps are to be stored
|
||||
savecore_flags="" # Used if dumpdev is enabled above, and present.
|
||||
|
40
etc/rc
40
etc/rc
@ -702,35 +702,47 @@ case ${usbd_enable} in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: Please keep the sendmail startup code here in sync with the code
|
||||
# in src/etc/mail/Makefile.
|
||||
case ${sendmail_enable} in
|
||||
[Nn][Oo][Nn][Ee])
|
||||
;;
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail'
|
||||
/usr/sbin/sendmail ${sendmail_flags}
|
||||
;;
|
||||
*)
|
||||
case ${sendmail_outbound_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail-outbound'
|
||||
/usr/sbin/sendmail ${sendmail_outbound_flags}
|
||||
;;
|
||||
esac
|
||||
case ${sendmail_submit_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail-submit'
|
||||
/usr/sbin/sendmail ${sendmail_submit_flags}
|
||||
;;
|
||||
*)
|
||||
case ${sendmail_outbound_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail-outbound'
|
||||
/usr/sbin/sendmail ${sendmail_outbound_flags}
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -r /etc/mail/submit.cf ]; then
|
||||
case ${sendmail_msp_queue_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail-clientmqueue'
|
||||
/usr/sbin/sendmail ${sendmail_msp_queue_flags}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case ${sendmail_enable} in
|
||||
[Nn][Oo][Nn][Ee])
|
||||
;;
|
||||
*)
|
||||
if [ -r /etc/mail/submit.cf ]; then
|
||||
case ${sendmail_msp_queue_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' sendmail-clientmqueue'
|
||||
/usr/sbin/sendmail ${sendmail_msp_queue_flags}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
echo '.'
|
||||
|
||||
|
@ -1717,12 +1717,17 @@ these are the flags to pass to the
|
||||
.Xr lpd 8
|
||||
daemon.
|
||||
.It Va sendmail_enable
|
||||
.Pq Vt bool
|
||||
.Pq Vt str
|
||||
If set to
|
||||
.Dq Li YES ,
|
||||
run the
|
||||
.Xr sendmail 8
|
||||
daemon at system boot time.
|
||||
If set to
|
||||
.Dq Li NONE ,
|
||||
do not run any
|
||||
.Xr sendmail 8
|
||||
daemons at system boot time.
|
||||
.It Va sendmail_flags
|
||||
.Pq Vt str
|
||||
If
|
||||
@ -1754,9 +1759,11 @@ as a non-set-user-ID binary.
|
||||
.Pq Vt bool
|
||||
If set to
|
||||
.Dq Li YES
|
||||
and
|
||||
and both
|
||||
.Va sendmail_enable
|
||||
is set to
|
||||
and
|
||||
.Va sendmail_submit_enable
|
||||
are set to
|
||||
.Dq Li NO ,
|
||||
run
|
||||
.Xr sendmail 8
|
||||
@ -1768,9 +1775,11 @@ This is intended to allow local mail queue management
|
||||
for systems that do not offer a listening SMTP service.
|
||||
.It Va sendmail_outbound_flags
|
||||
.Pq Vt str
|
||||
If
|
||||
If both
|
||||
.Va sendmail_enable
|
||||
is set to
|
||||
and
|
||||
.Va sendmail_submit_enable
|
||||
are set to
|
||||
.Dq Li NO
|
||||
and
|
||||
.Va sendmail_outbound_enable
|
||||
|
Loading…
Reference in New Issue
Block a user