Effectively remove sendmail from base
authorJohn Marino <draco@marino.st>
Sat, 7 Mar 2015 23:45:13 +0000 (00:45 +0100)
committerJohn Marino <draco@marino.st>
Sun, 8 Mar 2015 01:53:46 +0000 (02:53 +0100)
The NO_SENDMAIL build knob has been hardwired in sys.mk, so it is not
possible for it to be unset by /etc/make.conf.  This effectively prevents
sendmail from building.

A new check was added to "make upgrade" target to make sure the current
/etc/mail/mailer.conf is not configured to use the base sendmail as the
MTA.  If it fails the check, the upgrade will fail before it starts.
Directions are given hot to fix the problem in the error message.  A
successful check results in the sendmail-related binaries getting removed
from the system.

Finally, NO_SENDMAIL has been removed from the default make.conf and it's
man page.

The actual sendmail makefiles and source remain for now.  Once it is
confirmed that transition is working and dma is functioning well as a
replacement, sendmail and the NO_SENDMAIL conditions will be removed
permanently, along with modifying the mtree files.

Approved-by: dillon

Makefile_upgrade.inc
etc/Makefile
etc/defaults/make.conf
share/man/man5/make.conf.5
share/mk/sys.mk

index 46a0fed..9072309 100644 (file)
@@ -2826,6 +2826,32 @@ TO_REMOVE+=/usr/share/man/man3/libhammer_free_volinfo.3.gz
 TO_REMOVE+=/usr/share/man/cat3/libhammer_free_volinfo.3.gz
 TO_REMOVE+=/usr/share/examples/cvsup
 TO_REMOVE+=/usr/include/sys/xwait.h
+TO_REMOVE+=/bin/rmail
+TO_REMOVE+=/usr/bin/vacation
+TO_REMOVE+=/usr/sbin/editmap
+TO_REMOVE+=/usr/sbin/mailstats
+TO_REMOVE+=/usr/sbin/makemap
+TO_REMOVE+=/usr/sbin/praliases
+TO_REMOVE+=/usr/lib/libmilter.a
+TO_REMOVE+=/usr/lib/libmilter.so
+TO_REMOVE+=/usr/lib/libmilter.so.3
+TO_REMOVE+=/usr/libexec/mail.local
+TO_REMOVE+=/usr/libexec/smrsh
+TO_REMOVE+=/usr/libexec/sendmail
+TO_REMOVE+=/usr/share/man/man1/mailq.1.gz
+TO_REMOVE+=/usr/share/man/man1/newaliases.1.gz
+TO_REMOVE+=/usr/share/man/man1/vacation.1.gz
+TO_REMOVE+=/usr/share/man/man8/editmap.8.gz
+TO_REMOVE+=/usr/share/man/man8/hoststat.8.gz
+TO_REMOVE+=/usr/share/man/man8/mail.local.8.gz
+TO_REMOVE+=/usr/share/man/man8/mailstats.8.gz
+TO_REMOVE+=/usr/share/man/man8/makemap.8.gz
+TO_REMOVE+=/usr/share/man/man8/praliases.8.gz
+TO_REMOVE+=/usr/share/man/man8/purgestat.8.gz
+TO_REMOVE+=/usr/share/man/man8/rmail.8.gz
+TO_REMOVE+=/usr/share/man/man8/sendmail.8.gz
+TO_REMOVE+=/usr/share/man/man8/smrsh.8.gz
+TO_REMOVE+=/usr/share/sendmail
 
 .if ${MACHINE_ARCH} == "x86_64"
 TO_REMOVE+=/usr/sbin/stlstats
index 4737b7b..6a292e6 100644 (file)
@@ -137,7 +137,19 @@ preupgrade:
        (pw -V ${DESTDIR}/etc groupshow _dhcp -q > /dev/null) || \
                pw -V ${DESTDIR}/etc groupadd _dhcp -g 77
 
-upgrade_etc:   preupgrade remove-obsolete-files
+upgrade_check:
+       @if [ -n "`grep '^sendmail.*/usr/libexec/sendmail/sendmail' ${DESTDIR}/etc/mail/mailer.conf`" ]; then \
+               echo "==================================================================" ; \
+               echo "=  sendmail is being removed from the base system." ; \
+               echo "=  /etc/mail/mailer.conf is still configured to use sendmail." ; \
+               echo "=  See http://www.dragonflybsd.com/docs/docs/newhandbook/mta/" ; \
+               echo "=  Quick: echo > ${DESTDIR}/etc/mail/mailer.conf, then make upgrade " ; \
+               echo "=  then cp ${DESTDIR}/etc/mail/mailer.conf.dma ${DESTDIR}/etc/mail/mailer.conf" ; \
+               echo "==================================================================" ; \
+               /usr/bin/false ; \
+       fi
+
+upgrade_etc:   upgrade_check preupgrade remove-obsolete-files
        # files that should be dirs (not possible with Makefile_upgrade.inc)
 .for f in usr/include/dev/misc/ppi usr/share/initrd/sbin
        [ -d ${DESTDIR}/${f} ] || rm -f ${DESTDIR}/${f}
index 7f00342..249b2d4 100644 (file)
@@ -112,7 +112,6 @@ THREAD_LIB?=        thread_xu
 #NO_MODULES=   true    # do not build modules with the kernel
 #NO_OPENSSH=   true    # do not build OpenSSH
 #NO_OPENSSL=   true    # do not build OpenSSL (implies NO_OPENSSH)
-#NO_SENDMAIL=  true    # do not build sendmail and related programs
 #NO_SHARE=     true    # do not enter the share subdirectory
 #NOINFO=       true    # do not make or install info files
 #NOINFOCOMPRESS=true   # do not compress info files
index 57b7427..285efbc 100644 (file)
@@ -417,11 +417,6 @@ Set to not build OpenSSH.
 .Pq Vt bool
 Set to not build OpenSSL (implies
 .Va NO_OPENSSH ) .
-.It Va NO_SENDMAIL
-.Pq Vt bool
-Set to not build
-.Xr sendmail 8
-and related programs.
 .It Va NO_SHARE
 .Pq Vt bool
 Set to not enter the share subdirectory.
index 3996879..8bb42c5 100644 (file)
@@ -312,6 +312,13 @@ __MAKE_CONF?=/etc/make.conf
 .include "${__MAKE_CONF}"
 .endif
 
+# Temporary - hardcode NO_SENDMAIL after make.conf inclusion to ensure
+# sendmail will not be built.  After verifying sendmail is effectively out
+# of base and DMA functions a replacement, sendmail and NO_SENDMAIL will
+# be properly removed from code base.
+
+NO_SENDMAIL=   yes
+
 .include <bsd.cpu.mk>
 
 .if exists(/etc/make.conf.local)