Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jun 2020 02:38:54 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361720 - in head: etc etc/mail usr.sbin/mailwrapper
Message-ID:  <202006020238.0522cswW076778@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Jun  2 02:38:54 2020
New Revision: 361720
URL: https://svnweb.freebsd.org/changeset/base/361720

Log:
  pkgbase: resolve mailer.conf conflict WITHOUT_SENDMAIL
  
  When WITHOUT_SENDMAIL is set, we end up with two different mailer.conf that
  conflict, and hilarity ensues. There's currently three different places that
  we might install mailer.conf:
  
  - ^/etc/Makefile (package=runtime, contingent on MK_MAIL != no)
  - ^/libexec/dma/dmagent/Makefile (package=dma, contingent on MK_SENDMAIL !=
  no)
  - ^/usr.sbin/mailwrapper/Makefile (package=utilities, contingent on
  not-installed)
  
  The mailwrapper installation will effectively never happen because the ^/etc
  one will first.
  
  This patch simplifies the whole situation; remove the ^/etc/Makefile version
  and install it primarily in mailwrapper if MK_MAILWRAPPER != "no". The
  scenarios covered in mailwrapper are:
  
  - sendmail(8) is installed, dma(8) may or may not be installed
  - neither sendmail(8) nor dma(8) is installed
  
  In the first scenario, sendmail(8) is dominant so we can go ahead and
  install the version in ^/etc/mail. In the unlisted scenario, sendmail(8) is
  not installed but dma(8) is, we'll let ^/libexec/dma/dmagent do the
  installation. In the second listed scenario, we still want to install an
  example mailer.conf so just install the base sendmail(8) version.
  
  Reviewed by:	bapt
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D24924

Modified:
  head/etc/Makefile
  head/etc/mail/mailer.conf
  head/usr.sbin/mailwrapper/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Tue Jun  2 01:21:48 2020	(r361719)
+++ head/etc/Makefile	Tue Jun  2 02:38:54 2020	(r361720)
@@ -17,11 +17,10 @@ SUBDIR+=sendmail
 
 # NB: keep these sorted by MK_* knobs
 
-.if ${MK_SENDMAIL} == "no"
-ETCMAIL=mailer.conf aliases
-.else
-ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
-	mailertable.sample aliases
+ETCMAIL=aliases
+.if ${MK_SENDMAIL} != "no"
+ETCMAIL+=Makefile README access.sample virtusertable.sample \
+	mailertable.sample
 .endif
 
 # Special top level files for FreeBSD

Modified: head/etc/mail/mailer.conf
==============================================================================
--- head/etc/mail/mailer.conf	Tue Jun  2 01:21:48 2020	(r361719)
+++ head/etc/mail/mailer.conf	Tue Jun  2 02:38:54 2020	(r361720)
@@ -2,6 +2,9 @@
 #
 # Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
 #
+# If dma(8) is installed, an example mailer.conf that uses dma(8) instead can
+# can be found in /usr/share/examples/dma.
+#
 sendmail	/usr/libexec/sendmail/sendmail
 mailq		/usr/libexec/sendmail/sendmail
 newaliases	/usr/libexec/sendmail/sendmail

Modified: head/usr.sbin/mailwrapper/Makefile
==============================================================================
--- head/usr.sbin/mailwrapper/Makefile	Tue Jun  2 01:21:48 2020	(r361719)
+++ head/usr.sbin/mailwrapper/Makefile	Tue Jun  2 02:38:54 2020	(r361720)
@@ -26,7 +26,11 @@ SYMLINKS+=	..${BINDIR}/mailwrapper /bin/rmail
 .endif
 
 .if ${MK_MAILWRAPPER} != "no"
-.if !exists(${DESTDIR}/etc/mail/mailer.conf)
+# We install here if either sendmail(8) is enabled, or dma(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"
 FILES=		${SRCTOP}/etc/mail/mailer.conf
 FILESDIR=	/etc/mail
 FILESMODE=	644



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006020238.0522cswW076778>