aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>2000-07-08 02:52:32 +0800
committersteve <steve@FreeBSD.org>2000-07-08 02:52:32 +0800
commit07471b3e12ed3787e2978fb539e52e685da4ebbf (patch)
tree9bc928c8cdd0cdc68834ad948ce29e7f73230856 /mail
parentb87eac8156f270b5a44b317b624e82f1d58056ae (diff)
downloadfreebsd-ports-graphics-07471b3e12ed3787e2978fb539e52e685da4ebbf.tar.gz
freebsd-ports-graphics-07471b3e12ed3787e2978fb539e52e685da4ebbf.tar.zst
freebsd-ports-graphics-07471b3e12ed3787e2978fb539e52e685da4ebbf.zip
- Don't hardcode /usr/local.
- Also add a mailer.conf that allows sendmail to be replaced with qmail. PR: 19449 Submitted by: Mike Meyer <mwm@mired.org> and maintainer
Diffstat (limited to 'mail')
-rw-r--r--mail/qmail/Makefile99
-rw-r--r--mail/qmail/files/PORT_NOTES_FreeBSD_40-RELEASE7
-rw-r--r--mail/qmail/files/mailer.conf.sample8
-rw-r--r--mail/qmail/pkg-message8
-rw-r--r--mail/qmail/pkg-plist5
5 files changed, 120 insertions, 7 deletions
diff --git a/mail/qmail/Makefile b/mail/qmail/Makefile
index 9e2ed7499a0..1113a5f4e96 100644
--- a/mail/qmail/Makefile
+++ b/mail/qmail/Makefile
@@ -54,7 +54,8 @@ PLIST_SUB= DOCDIR=${DOCDIR}
DOCFILES+= ${WRKSRC}/BLURB ${WRKSRC}/BLURB2 ${WRKSRC}/BLURB3 \
${WRKSRC}/BLURB4 ${WRKSRC}/INTERNALS ${WRKSRC}/SECURITY \
${WRKSRC}/THOUGHTS ${FILESDIR}/PORT_NOTES \
- ${FILESDIR}/PORT_NOTES_FreeBSD_40-RELEASE
+ ${FILESDIR}/PORT_NOTES_FreeBSD_40-RELEASE \
+ ${WRKDIR}/mailer.conf.sample
# The following docfiles are normally installed with qmail-hier
DOCFILES+= ${WRKSRC}/FAQ ${WRKSRC}/UPGRADE ${WRKSRC}/SENDMAIL \
@@ -135,10 +136,10 @@ do-install:
@# This is not part of qmail proper, hence the 2nd class citizenship
${INSTALL_SCRIPT} ${FILESDIR}/mkaliasdir ${PREFIX}/${DOCDIR}
@cd ${PREFIX}/configure ; ./config
- @${MKDIR} /usr/local/etc/rc.d
- @${LN} -sf ${PREFIX}/rc /usr/local/etc/rc.d/qmail.sh
+ @${MKDIR} ${LOCALBASE}/etc/rc.d
+ @${LN} -sf ${PREFIX}/rc ${LOCALBASE}/etc/rc.d/qmail.sh
@${ECHO}
- @${SED} s!/var/qmail!${PREFIX}/!g ${PKGDIR}/MESSAGE | /usr/bin/fmt
+ @${SED} s!/var/qmail!${PREFIX}!g ${PKGDIR}/MESSAGE | /usr/bin/fmt
# hack to allow slave ports to include bsd.port.pre.mk and then this file
.if defined(_PREMKINCLUDED)
@@ -150,7 +151,7 @@ do-install:
# Ugh... ;-)
thereal-post-patch:
.for i in ${BOOTFILES}
- if [ `dirname $i` != ${FILESDIR} ] ; \
+ @if [ `dirname $i` != ${FILESDIR} ] ; \
then \
${CP} $i.sh $i.sh.orig; \
(head -c `${EXPR} \`ls -l $i.sh.orig \
@@ -158,6 +159,94 @@ thereal-post-patch:
> $i.sh ; \
fi
.endfor
+ @${SED} s!/var/qmail/!${PREFIX}/!g ${FILESDIR}/mailer.conf.sample > \
+ ${WRKDIR}/mailer.conf.sample
+
+# Double Ugh... ;-)
+${WRKDIR}/.thereal_disable_sendmail_done:
+ @if [ ! -d ${WRKDIR} ]; \
+ then \
+ ${MKDIR} ${WRKDIR} ; \
+ fi
+
+# I would like some input on the targets below. Only constructive ones
+# please. :)
+# based on shells/pdksh /etc/shells update PLIST.
+thereal-disable-sendmail: ${WRKDIR}/.thereal_disable_sendmail_done /etc/rc.conf
+ @if [ -f /etc/rc.conf ]; \
+ then \
+ ${CP} /etc/rc.conf /etc/rc.conf.bak && \
+ ${GREP} -v sendmail_enable /etc/rc.conf.bak > \
+ /etc/rc.conf && \
+ ${TOUCH} ${WRKDIR}/.thereal_disable_sendmail_done ; \
+ else \
+ ${ECHO_MSG} ¨===> ERROR: YOU DO NOT HAVE A VALID /etc/rc.conf¨ ; \
+ ${ECHO_MSG} ¨===> FIX this and try again¨ ; \
+ ${FALSE} ; \
+ fi
+
+disable-sendmail: thereal-disable-sendmail
+ @${ECHO_MSG} "===> I hope you know what you are doing:"
+ @${ECHO_MSG} "===> You just told your system to not"
+ @${ECHO_MSG} "===> automaticaly start sendmail on your"
+ @${ECHO_MSG} "===> next startup."
+ @${ECHO_MSG} "===> (i.e., added sendmail_enable=\¨NO\¨ to rc.conf)"
+ @if [ -f /etc/rc.conf ]; \
+ then \
+ ${ECHO} sendmail_enable=\"NO\" >> /etc/rc.conf ; \
+ fi
+
+enable-sendmail: thereal-disable-sendmail
+ @${ECHO_MSG} "===> I hope you know what you are doing:"
+ @${ECHO_MSG} "===> You just told your system to"
+ @${ECHO_MSG} "===> automaticaly start sendmail on your"
+ @${ECHO_MSG} "===> next startup."
+ @${ECHO_MSG} "===> (i.e., removed sendmail_enable=\¨NO\¨ from rc.conf)"
+
+enable-qmail: install disable-sendmail
+ @if [ -f /etc/mail/mailer.conf ]; \
+ then \
+ ${CP} /etc/mail/mailer.conf /etc/mail/mailer.conf.bak && \
+ ${CP} ${WRKDIR}/mailer.conf.sample /etc/mail/mailer.conf ; \
+ else \
+ ${ECHO_MSG} "===> ERROR: YOU DO NOT HAVE A VALID /etc/mail/mailer.conf" ; \
+ ${ECHO_MSG} "===> FIX this and try again" ; \
+ ${ECHO_MSG} "===> or, do \¨make force_enable_qmail\¨ if you are sure" ; \
+ ${ECHO_MSG} "===> you want this port replacing some binaries" ; \
+ ${ECHO_MSG} "===> IF THIS FEELS UNEASY, read ${PREFIX}/${DOCDIR}/REMOVE.sendmail and do it manually" ; \
+ fi
+ @${ECHO} "===> Do not forget to choose an appropriate qmail startup"
+ @${ECHO} "===> script. Go through ${PREFIX}/boot, choose one"
+ @${ECHO} "===> and copy the chosen script as ${PREFIX}/rc"
+ @${ECHO} "===> For example, \¨cp ${PREFIX}/boot/proc+df ${PREFIX}/rc\¨"
+
+
+# taken from mail/postfix idea
+force-enable-qmail: install disable-sendmail
+ @${ECHO_MSG} "===> Replacing sendmail"
+ @if [ -e /usr/sbin/sendmail ]; then \
+ ${MV} -f /usr/sbin/sendmail /usr/sbin/sendmail.OFF && \
+ ${CHMOD} 0 /usr/sbin/sendmail.OFF; \
+ fi
+ @if [ -e ${PREFIX}/bin/sendmail ]; then \
+ ${LN} -s ${PREFIX}/bin/sendmail /usr/sbin/sendmail; \
+ fi
+ @${ECHO_MSG} "===> Replacing mailq"
+ @if [ -e /usr/bin/mailq ]; then \
+ ${MV} -f /usr/bin/mailq /usr/bin/mailq.OFF && \
+ ${CHMOD} 0 /usr/bin/mailq.OFF; \
+ fi
+ @if [ -e ${PREFIX}/bin/qmail-qread ]; then \
+ ${LN} -s ${PREFIX}/bin/qmail-qread /usr/bin/mailq; \
+ fi
+ @${ECHO_MSG} "===> Replacing newaliases"
+ @if [ -e /usr/bin/newaliases ]; then \
+ ${MV} -f /usr/bin/newaliases /usr/bin/newaliases.OFF && \
+ ${CHMOD} 0 /usr/bin/newaliases.OFF; \
+ fi
+ @if [ -e ${PREFIX}/bin/newaliases ]; then \
+ ${LN} -s ${PREFIX}/bin/newaliases /usr/bin/newaliases; \
+ fi
# The users are instructed (in PORT_NOTES) to install ${QUEUE_DIR}/rc
# themselves. Each /var/qmail/ should have its own rc. On many machines,
diff --git a/mail/qmail/files/PORT_NOTES_FreeBSD_40-RELEASE b/mail/qmail/files/PORT_NOTES_FreeBSD_40-RELEASE
index a3b92efed63..25963439d60 100644
--- a/mail/qmail/files/PORT_NOTES_FreeBSD_40-RELEASE
+++ b/mail/qmail/files/PORT_NOTES_FreeBSD_40-RELEASE
@@ -45,9 +45,14 @@ Here follows my personal /etc/mail/mailer.conf
sendmail /var/qmail/bin/sendmail
send-mail /var/qmail/bin/sendmail
-mailq /var/qmail/bin/qmail-qstat
+mailq /var/qmail/bin/qmail-qread
newaliases /var/qmail/bin/newaliases
+There is a sample mailer.conf in this directory, please install
+over the /etc/mail/mailer.conf to unfold qmail as your default MTA.
+Please don´t forget to backup /etc/mail/mailer.conf before doing
+so. Better safe then sorry.
+
So, whenever you call sendmail, in fact, you are using the appropriate
"qmail-clones".
diff --git a/mail/qmail/files/mailer.conf.sample b/mail/qmail/files/mailer.conf.sample
new file mode 100644
index 00000000000..970dcbe55f3
--- /dev/null
+++ b/mail/qmail/files/mailer.conf.sample
@@ -0,0 +1,8 @@
+# Configuration for mailwrapper is kept in /etc/mail/mailer.conf.
+# Replace that file with this one to enable qmail under a sendmail
+# disguise. Very useful.
+
+sendmail /var/qmail/bin/sendmail
+send-mail /var/qmail/bin/sendmail
+mailq /var/qmail/bin/qmail-qread
+newaliases /var/qmail/bin/newaliases
diff --git a/mail/qmail/pkg-message b/mail/qmail/pkg-message
index 008d54bf1f4..6b860bd3cbd 100644
--- a/mail/qmail/pkg-message
+++ b/mail/qmail/pkg-message
@@ -6,3 +6,11 @@ qmail, and finally replacing sendmail with qmail.
You should also add /var/qmail/man to your MANPATH (see manpath(1)
or login.conf(5)).
+
+You can enable qmail as your default mailer:
+
+# this will disable the default MTA
+1) do "make disable-sendmail"
+
+# enable qmail as your default MTA
+2) do "make enable-qmail"
diff --git a/mail/qmail/pkg-plist b/mail/qmail/pkg-plist
index a92bd910698..13d33730f3b 100644
--- a/mail/qmail/pkg-plist
+++ b/mail/qmail/pkg-plist
@@ -148,6 +148,7 @@ configure/dnsptr
%%DOCDIR%%/PORT_NOTES
%%DOCDIR%%/PORT_NOTES_FreeBSD_40-RELEASE
%%DOCDIR%%/SYSDEPS
+%%DOCDIR%%/mailer.conf.sample
%%DOCDIR%%/mkaliasdir
boot/maildir
@dirrm %%DOCDIR%%
@@ -155,4 +156,6 @@ boot/maildir
@dirrm boot
@dirrm bin
-@unexec echo "If you are permanently removing qmail, you should also ``rm -Rf ${PKG_PREFIX}/alias ${PKG_PREFIX}/control ${PKG_PREFIX}/queue ${PKG_PREFIX}/users'' and remove the qmail users/groups." | /usr/bin/fmt
+@unexec echo "1) If you are permanently removing qmail, you should also ``rm -Rf ${PKG_PREFIX}/alias ${PKG_PREFIX}/control ${PKG_PREFIX}/queue ${PKG_PREFIX}/users'' and remove the qmail users/groups." | /usr/bin/fmt
+@unexec echo "2) Do not forget to reconfigure your /etc/mail/mailer.conf to use your older MTA, or reconfigure your old MTA binaries if you decided to replace them." | /usr/bin/fmt
+@unexec echo "3) Do not forget to enable sendmail as your default MTA if you have to. Go to mail/qmail portsdir and do a 'make enable-sendmail'" | /usr/bin/fmt