summaryrefslogtreecommitdiffstats
path: root/etc/mail
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-03-28 03:30:27 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-03-28 03:30:27 +0000
commite33a1d7e19aca5a5f83e60320432f89ecd4b7974 (patch)
tree7bb330364a0cfd15ca5e8bae2ac62961964d4478 /etc/mail
parentcdfdb8738b09b4df46928d752fd71e5c3de88f1a (diff)
downloadFreeBSD-src-e33a1d7e19aca5a5f83e60320432f89ecd4b7974.zip
FreeBSD-src-e33a1d7e19aca5a5f83e60320432f89ecd4b7974.tar.gz
Update the /etc/mail/Makefile "start" target code to match the new startup
logic and added a new set of targets for controlling the MSP queue runner (start-mspq, stop-mspq, and restart-mspq). Reminded by: Mark Santcroos <marks@ripe.net> MFC after: 1 week
Diffstat (limited to 'etc/mail')
-rw-r--r--etc/mail/Makefile55
1 files changed, 51 insertions, 4 deletions
diff --git a/etc/mail/Makefile b/etc/mail/Makefile
index c55beca..b92f6b3 100644
--- a/etc/mail/Makefile
+++ b/etc/mail/Makefile
@@ -11,11 +11,19 @@
# maps - Build the feature maps
# aliases - Build the sendmail aliases
# install - Install the .cf file as /etc/mail/sendmail.cf
+#
+# For the MTA daemon:
# start - Start the sendmail daemon with the flags defined in
# /etc/defaults/rc.conf or /etc/rc.conf
# stop - Stop the sendmail daemon
# restart - Restart the sendmail daemon
#
+# For the MSP queue running daemon:
+# start-mspq - Start the sendmail MSP queue running daemon with the
+# flags defined in /etc/defaults/rc.conf or /etc/rc.conf
+# stop-mspq - Stop the sendmail MSP queue running daemon
+# restart-mspq - Restart the sendmail MSP queue running daemon
+#
# Calling `make' will generate the updated versions when either the
# aliases or one of the map files were changed.
#
@@ -65,6 +73,7 @@ SENDMAIL_CF_DIR?= /usr/src/contrib/sendmail/cf
# The pid is used to stop and restart the running daemon.
#
SENDMAIL_PIDFILE?= /var/run/sendmail.pid
+SENDMAIL_MSPQ_PIDFILE?= /var/spool/clientmqueue/sm-client.pid
#
# Some useful programs we need.
@@ -164,15 +173,28 @@ install: ${INSTALL_CF}
.endif
start:
- (. /etc/defaults/rc.conf; source_rc_confs; \
+ @(. /etc/defaults/rc.conf; source_rc_confs; \
case "$${sendmail_enable}" in \
+ [Nn][Oo][Nn][Ee]) \
+ echo "ERROR: sendmail_enable is set to $${sendmail_enable}" \
+ ;; \
[Yy][Ee][Ss]) \
- /usr/sbin/sendmail $${sendmail_flags} \
+ ${SENDMAIL} $${sendmail_flags}; \
+ echo "${SENDMAIL} $${sendmail_flags}" \
;; \
*) \
- case "$${sendmail_outbound_enable}" in \
+ case "$${sendmail_submit_enable}" in \
[Yy][Ee][Ss]) \
- /usr/sbin/sendmail $${sendmail_outbound_flags} \
+ ${SENDMAIL} $${sendmail_submit_flags}; \
+ echo "${SENDMAIL} $${sendmail_submit_flags}" \
+ ;; \
+ *) \
+ case "$${sendmail_outbound_enable}" in \
+ [Yy][Ee][Ss]) \
+ ${SENDMAIL} $${sendmail_outbound_flags}; \
+ echo "${SENDMAIL} $${sendmail_outbound_flags}" \
+ ;; \
+ esac \
;; \
esac \
;; \
@@ -185,6 +207,31 @@ stop:
restart:
${KILL} -HUP `head -1 ${SENDMAIL_PIDFILE}`
+start-mspq:
+ @(. /etc/defaults/rc.conf; source_rc_confs; \
+ case "$${sendmail_enable}" in \
+ [Nn][Oo][Nn][Ee]) \
+ echo "ERROR: sendmail_enable is set to $${sendmail_enable}" \
+ ;; \
+ *) \
+ if [ -r /etc/mail/submit.cf ]; then \
+ case "$${sendmail_msp_queue_enable}" in \
+ [Yy][Ee][Ss]) \
+ ${SENDMAIL} $${sendmail_msp_queue_flags}; \
+ echo "${SENDMAIL} $${sendmail_msp_queue_flags}" \
+ ;; \
+ esac \
+ fi \
+ ;; \
+ esac \
+ )
+
+stop-mspq:
+ ${KILL} -TERM `head -1 ${SENDMAIL_MSPQ_PIDFILE}`
+
+restart-mspq:
+ ${KILL} -HUP `head -1 ${SENDMAIL_MSPQ_PIDFILE}`
+
# User defined targets
.if exists(Makefile.local)
.include "Makefile.local"
OpenPOWER on IntegriCloud