From 545f1377ff4ba12a5f4578698a99f6e26ec9e876 Mon Sep 17 00:00:00 2001 From: John Marino Date: Tue, 10 Mar 2015 11:46:07 +0100 Subject: [PATCH] sendmail transition: Do not pre-generate sendmail.cf Originally a starter sendmail.cf file was created using the .mc template files and the m4 files installed from contrib/sendmail-8.14 directory. This starter sendmail.cf was installed with "make distribution". The template files were only changed with "make upgrade" (not sure why but maybe people tried editing them directly) and the Makefile was only installed once. This commit accomplishes these things: * No sendmail.cf or submit.cf file is created. This was the last user of contrib/sendmail-8.14 * etc/sendmail was altered to just install files * the README file the was recently placed in libexec/dma was relocated to etc/sendmail and updated * the /etc/mail/Makefile is now updated with installworld * the dragonfl*.mc templates are now updated with installworld The suggested method to creating /etc/mail/sendmail.cf and /etc/mail/submit.cf now on a new system is: 1. cd /etc/mail 2. type "make cf" 3. edit new .mc and .submit.mc files 4. type "make cf" again 5. type "make install" --- etc/Makefile | 4 +- etc/sendmail/Makefile | 97 +++---------------- .../Makefile => sendmail/Makefile.4install} | 0 .../dma/mailer-conf => etc/sendmail}/README | 13 ++- libexec/dma/mailer-conf/Makefile | 3 +- 5 files changed, 23 insertions(+), 94 deletions(-) rename etc/{mail/Makefile => sendmail/Makefile.4install} (100%) rename {libexec/dma/mailer-conf => etc/sendmail}/README (82%) diff --git a/etc/Makefile b/etc/Makefile index 9ab29f44c6..142488012f 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -60,8 +60,8 @@ MTREE= BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \ PPPCNF= ppp.conf -ETCMAIL=Makefile mailer.conf access.sample virtusertable.sample \ - mailertable.sample aliases +ETCMAIL=aliases mailer.conf access.sample virtusertable.sample \ + mailertable.sample # List of libraries in /usr/lib/compat that might have to be removed # from /usr/lib. diff --git a/etc/sendmail/Makefile b/etc/sendmail/Makefile index 5e280d3efe..7631930741 100644 --- a/etc/sendmail/Makefile +++ b/etc/sendmail/Makefile @@ -1,92 +1,19 @@ -# @(#)Makefile 8.19 (Berkeley) 1/14/97 -# $FreeBSD: src/etc/sendmail/Makefile,v 1.31 2004/01/22 17:51:02 ru Exp $ +# This installs the sendmail mc templates and the makefile used to +# generate sendmail.cf and sendmail.submit.cf. A README is also installed -M4= m4 -CHMOD= chmod -ROMODE= 444 -RM= rm -f +FILESDIR= /etc/mail/ +FILESMODE= 644 -SENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail-8.14 -SMDIR= ${SENDMAIL_DIR}/sendmail -SENDMAIL_CF_DIR?=${SENDMAIL_DIR}/cf +FILES+= Makefile \ + README \ + dragonfly.mc \ + dragonfly.submit.mc -# this is overkill, but.... -M4FILES!= find ${SENDMAIL_CF_DIR} -type f -name '*.m4' -print +CLEANFILES= Makefile -.SUFFIXES: .mc .cf +Makefile: Makefile.4install + cp ${.ALLSRC} ${.TARGET} -.mc.cf: ${M4FILES} - ${RM} ${.TARGET} - ${M4} -D_CF_DIR_=${SENDMAIL_CF_DIR}/ ${SENDMAIL_M4_FLAGS} \ - ${SENDMAIL_CF_DIR}/m4/cf.m4 ${.IMPSRC} > ${.TARGET} - ${CHMOD} ${ROMODE} ${.TARGET} - -DEST_CF= ${DESTDIR}/etc/mail/sendmail.cf -DEST_SUBMIT_CF= ${DESTDIR}/etc/mail/submit.cf - -ALL= dragonfly.cf dragonfly.submit.cf -CLEANFILES= dragonfly.cf dragonfly.submit.cf - -# Local SENDMAIL_MC may be set in /etc/make.conf. -# Warning! If set, this causes 'make install' to always copy it -# over /etc/mail/sendmail.cf!!! -# Caveat emptor! Be sure you want this before you enable it. -.if defined(SENDMAIL_MC) -INSTALL_CF= ${SENDMAIL_MC:T:R}.cf -ALL+= ${INSTALL_CF} -CLEANFILES+= ${SENDMAIL_MC:T:R}.cf -${INSTALL_CF}: ${SENDMAIL_MC} -.endif - -.if defined(SENDMAIL_SUBMIT_MC) -INSTALL_SUBMIT_CF= ${SENDMAIL_SUBMIT_MC:T:R}.cf -ALL+= ${INSTALL_SUBMIT_CF} -CLEANFILES+= ${INSTALL_SUBMIT_CF} -${INSTALL_SUBMIT_CF}: ${SENDMAIL_SUBMIT_MC} -.endif - -# Additional .cf files to build. -.if defined(SENDMAIL_ADDITIONAL_MC) -SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:T:S/.mc$/.cf/} -ALL+= ${SENDMAIL_ADDITIONAL_CF} -CLEANFILES+= ${SENDMAIL_ADDITIONAL_CF} -.for mc in ${SENDMAIL_ADDITIONAL_MC} -${mc:T:R}.cf: ${mc} -.endfor -.endif - -all: ${ALL} - -distribution: dragonfly.cf dragonfly.submit.cf - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${.CURDIR}/dragonfly.mc dragonfly.cf ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${.CURDIR}/dragonfly.submit.mc dragonfly.submit.cf ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 \ - /dev/null ${DESTDIR}/var/log/sendmail.st - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dragonfly.cf ${DEST_CF} - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - dragonfly.submit.cf ${DEST_SUBMIT_CF} - -upgrade: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${.CURDIR}/dragonfly.mc ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${.CURDIR}/dragonfly.submit.mc ${DESTDIR}/etc/mail - -install: -.if defined(INSTALL_CF) && ${INSTALL_CF} != ${DEST_CF} - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${INSTALL_CF} ${DEST_CF} -.endif -.if defined(SENDMAIL_ADDITIONAL_CF) - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail -.endif -.if defined(INSTALL_SUBMIT_CF) && ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF} - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF} -.endif +beforedepend: Makefile .include diff --git a/etc/mail/Makefile b/etc/sendmail/Makefile.4install similarity index 100% rename from etc/mail/Makefile rename to etc/sendmail/Makefile.4install diff --git a/libexec/dma/mailer-conf/README b/etc/sendmail/README similarity index 82% rename from libexec/dma/mailer-conf/README rename to etc/sendmail/README index 237bdb2967..54b09b31f0 100644 --- a/libexec/dma/mailer-conf/README +++ b/etc/sendmail/README @@ -19,11 +19,14 @@ if both sendmail_enable and sendmail_submit_enable are set to "NO", you must do the following for command line submitted mail: Designate an alternative host for the submission agent to contact - by altering /etc/mail/dragonfly.submit.mc (or setting SENDMAIL_SUBMIT_MC - in /etc/make.conf to an alternate .mc file) and using - 'make install-submit-cf' in /etc/mail/. Change the FEATURE(msp) line - to FEATURE(msp, hostname) where hostname is the fully qualified hostname - of the alternative host. + by creating /etc/mail/.submit.mc or using an alternate .mc + file and setting SENDMAIL_SUBMIT_MC in /etc/make.conf. Do not edit + dragonfly.submit.mc directly as it will be overwritten eventually, but + it certainly can be copied to be used as a template. + + Type 'make install-submit-cf' in /etc/mail/ to generate the submit.cf + file. Change the FEATURE(msp) line to FEATURE(msp, hostname) where + hostname is the fully qualified hostname of the alternative host. Also, as of 8.12, a new queue-running daemon is started to make sure mail doesn't remain in the client mail queue. By default, it simply runs the diff --git a/libexec/dma/mailer-conf/Makefile b/libexec/dma/mailer-conf/Makefile index a5c20cb730..1e87febfce 100644 --- a/libexec/dma/mailer-conf/Makefile +++ b/libexec/dma/mailer-conf/Makefile @@ -4,8 +4,7 @@ FILESDIR= /etc/mail/ FILESMODE= 644 -FILES+= README \ - mailer.conf.dma \ +FILES+= mailer.conf.dma \ mailer.conf.opensmtpd \ mailer.conf.postfix \ mailer.conf.sendmail -- 2.41.0