diff options
authorBaptiste Daroussin <bapt@FreeBSD.org>2022-10-13 09:37:21 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2022-11-07 11:49:56 +0000
commita67b925ff3e58b072a60b633e442ee1d33e47f7f (patch)
parentbdbc05bea995d73465def1ab31bb3b2b37b37a93 (diff)
mail: make The Dragonfly Mail Agent (dma) the default mta.
dma accepts mail from a local Mail User Agent (MUA) and delivers it locally or to a smarthost for delivery. dma does not accept inbound mail (i.e., it does not listen on port 25) and is not intended to provide the same functionality as a full MTA like postfix or sendmail. It is intended for use cases such as delivering cron(8) mail. which is the default configuration and usage of sendmail in the default setup of the base system. In order to switch the default from sendmail to dma, we teach mailwrapper to fallback on dma directly if the mailer.conf file cannot be opened. We install by default a mailer.conf file which points at dma We install a mailer.conf file for sendmail in the examples. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D37035
4 files changed, 15 insertions, 13 deletions
diff --git a/libexec/dma/dmagent/Makefile b/libexec/dma/dmagent/Makefile
index f7f127cf4e7e..9c440b32e50f 100644
--- a/libexec/dma/dmagent/Makefile
+++ b/libexec/dma/dmagent/Makefile
@@ -24,11 +24,6 @@ YFLAGS+= -i
CLEANFILES= aliases_parse.i
FILES= mailer.conf
FILESDIR= ${SHAREDIR}/examples/dma
-.if ${MK_SENDMAIL} == no
-MAILERDIR= /etc/mail
-MAILER= mailer.conf
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index a71a3fa4063d..91b99780eae6 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -596,7 +596,7 @@ allscreens_kbdflags="" # Set this kbdcontrol mode for all virtual screens
# Script to start your chosen MTA, called by /etc/rc.
# Settings for /etc/rc.sendmail and /etc/rc.d/sendmail:
-sendmail_enable="NO" # Run the sendmail inbound daemon (YES/NO).
+sendmail_enable="NONE" # Run the sendmail inbound daemon (YES/NO).
sendmail_pidfile="/var/run/sendmail.pid" # sendmail pid file
sendmail_procname="/usr/sbin/sendmail" # sendmail process name
sendmail_flags="-L sm-mta -bd -q30m" # Flags to sendmail (as a server)
diff --git a/usr.sbin/mailwrapper/Makefile b/usr.sbin/mailwrapper/Makefile
index 3e5c46d7bdf4..0878a2f8c483 100644
--- a/usr.sbin/mailwrapper/Makefile
+++ b/usr.sbin/mailwrapper/Makefile
@@ -16,10 +16,10 @@ SYMLINKS= ../sbin/mailwrapper /usr/bin/mailq \
mailwrapper /usr/sbin/purgestat \
mailwrapper /usr/sbin/sendmail
-.if ${MK_MAILWRAPPER} == "no" && ${MK_SENDMAIL} != "no"
-SYMLINKS+= ../libexec/sendmail/sendmail ${BINDIR}/mailwrapper
-.elif ${MK_MAILWRAPPER} == "no" && ${MK_SENDMAIL} == "no" && ${MK_DMAGENT} != "no"
+.if ${MK_MAILWRAPPER} == "no" && ${MK_DMAGENT} != "no"
SYMLINKS+= ../libexec/dma ${BINDIR}/mailwrapper
+.elif ${MK_MAILWRAPPER} == "no" && ${MK_DMAGENT} == "no" && ${MK_SENDMAIL} != "no"
+SYMLINKS+= ../libexec/sendmail/sendmail ${BINDIR}/mailwrapper
@@ -27,16 +27,23 @@ SYMLINKS+= ../libexec/dma ${BINDIR}/mailwrapper
SYMLINKS+= ..${BINDIR}/mailwrapper /bin/rmail
+.if ${MK_SENDMAIL} != "no"
+FILES= ${SRCTOP}/etc/mail/mailer.conf
+FILESDIR= ${SHAREDIR}/examples/sendmail
.if ${MK_MAILWRAPPER} != "no"
-# We install here if either sendmail(8) is enabled, or dma(8) isn't. In the
+# We install here if either dma(8) is enabled, or sendmail(8) isn't. In the
# latter scenario, we take care of the possibility that neither sendmail(8) nor
# dma(8) are installed and simply provide a default that can be changed for an
# alternative in ports.
-.if ${MK_SENDMAIL} != "no" || ${MK_DMAGENT} == "no"
+.if ${MK_DMAGENT} != "no" || ${MK_SENDMAIL} == "no"
+CONFS= ${SRCTOP}/libexec/dma/dmagent/mailer.conf
CONFS= ${SRCTOP}/etc/mail/mailer.conf
CONFSDIR= /etc/mail
.include <bsd.prog.mk>
diff --git a/usr.sbin/mailwrapper/pathnames.h b/usr.sbin/mailwrapper/pathnames.h
index 5511d1eccff9..798648269f3e 100644
--- a/usr.sbin/mailwrapper/pathnames.h
+++ b/usr.sbin/mailwrapper/pathnames.h
@@ -34,4 +34,4 @@
#define _PATH_MAILERCONF "/etc/mail/mailer.conf"
-#define _PATH_DEFAULTMTA "/usr/libexec/sendmail/sendmail"
+#define _PATH_DEFAULTMTA "/usr/libexec/dma"