pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/qmail-run This package creates all the needed bas...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/50da9ba6c945
branches:  trunk
changeset: 478926:50da9ba6c945
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Mon Aug 02 03:59:21 2004 +0000

description:
This package creates all the needed basic config files to run qmail,
and provides NetBSD-style rc.d scripts and an example mailer.conf.

The rc.d scripts used to belong directly to the qmail package. Changes
made during the move here:

* Rename qmailfoo_softlimit to the more accurate qmailfoo_datalimit.
* Parameterize logging as qmailfoo_logcmd (default: splogger).
* Run all sploggers (not just qmail-send's) as user qmaill, rather than root.
* Replace "@CAT@" with "@HEAD@ -1" for files expected to contain one line.

diffstat:

 mail/qmail-run/DESCR                       |   2 +
 mail/qmail-run/INSTALL                     |  43 ++++++++++++++
 mail/qmail-run/MESSAGE                     |  21 ++++++
 mail/qmail-run/Makefile                    |  66 +++++++++++++++++++++
 mail/qmail-run/PLIST                       |   6 +
 mail/qmail-run/files/README.pkgsrc         |  44 ++++++++++++++
 mail/qmail-run/files/mailer.conf           |  10 +++
 mail/qmail-run/files/qmail-qread-client.sh |   7 ++
 mail/qmail-run/files/qmail.sh              |  90 +++++++++++++++++++++++++++++
 mail/qmail-run/files/qmailpop3d.sh         |  79 +++++++++++++++++++++++++
 mail/qmail-run/files/qmailqread.sh         |  31 ++++++++++
 mail/qmail-run/files/qmailsend.sh          |  92 ++++++++++++++++++++++++++++++
 mail/qmail-run/files/qmailsmtpd.sh         |  80 ++++++++++++++++++++++++++
 13 files changed, 571 insertions(+), 0 deletions(-)

diffs (truncated from 623 to 300 lines):

diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/DESCR      Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,2 @@
+This package creates all the needed basic config files to run qmail,
+and provides NetBSD-style rc.d scripts and an example mailer.conf.
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/INSTALL    Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,43 @@
+QMAIL_QUEUE_EXTRA=@QMAIL_QUEUE_EXTRA@
+
+psmsg='# This file was auto-generated by pkgsrc.'
+
+case ${STAGE} in
+
+POST-INSTALL)
+       cd ${LOCALBASE}/share/qmail/setup && ./config-fast `./hostname`
+
+       cd ${PKG_SYSCONFDIR}/alias && ${TOUCH} .qmail-postmaster .qmail-mailer-daemon .qmail-root
+
+       if ! [ -s ${PKG_SYSCONFDIR}/control/concurrencyincoming ]; then
+               ${ECHO} 20 > ${PKG_SYSCONFDIR}/control/concurrencyincoming
+               ${ECHO} $psmsg >> ${PKG_SYSCONFDIR}/control/concurrencyincoming
+               ${CHMOD} 644 ${PKG_SYSCONFDIR}/control/concurrencyincoming
+       fi
+
+       if ! [ -s ${PKG_SYSCONFDIR}/control/defaultdelivery ]; then
+               ${ECHO} ./Mailbox > ${PKG_SYSCONFDIR}/control/defaultdelivery
+               ${ECHO} $psmsg >> ${PKG_SYSCONFDIR}/control/defaultdelivery
+               ${CHMOD} 644 ${PKG_SYSCONFDIR}/control/defaultdelivery
+       fi
+
+       pop3rule=':allow'
+       smtprule='127.:allow,RELAYCLIENT=""'
+       for i in pop3 smtp; do
+               if ! [ -s ${PKG_SYSCONFDIR}/tcp.${i} ]; then
+                       ${ECHO} $psmsg > ${PKG_SYSCONFDIR}/tcp.${i}
+                       eval ${ECHO} \"\$${i}rule\" > ${PKG_SYSCONFDIR}/tcp.${i}
+               fi
+               ${CHMOD} 644 ${PKG_SYSCONFDIR}/tcp.${i}
+               ${LOCALBASE}/bin/tcprules ${PKG_SYSCONFDIR}/tcp.${i}.cdb ${PKG_SYSCONFDIR}/tcp.${i}.tmp < ${PKG_SYSCONFDIR}/tcp.${i}
+               ${CHMOD} 644 ${PKG_SYSCONFDIR}/tcp.${i}.cdb
+       done
+
+       if ! [ -z ${QMAIL_QUEUE_EXTRA} ]; then
+               ${ECHO} $psmsg >> ${PKG_SYSCONFDIR}/alias/.qmail-${QMAIL_QUEUE_EXTRA}
+               ${CHMOD} 644 ${PKG_SYSCONFDIR}/alias/.qmail-${QMAIL_QUEUE_EXTRA}
+       fi
+
+       ;;
+
+esac
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/MESSAGE    Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,21 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2004/08/02 03:59:21 schmonz Exp $
+
+To enable qmail for
+
+Local and outgoing deliveries:
+- Check the configuration files in ${PKG_SYSCONFDIR}.
+- Modify /etc/mailer.conf (see share/examples/qmail-run/mailer.conf).
+- Set qmailsend=YES in /etc/rc.conf.
+
+SMTP:
+- Set qmailsmtpd=YES in /etc/rc.conf.
+
+POP3 (only for Maildirs):
+- Set qmailpop3d=YES in /etc/rc.conf.
+
+Make the queue visible to local non-root users:
+- Set qmailqread=YES in /etc/rc.conf.
+- Change the mailq entry in /etc/mailer.conf to qmail-qread-client.
+
+===========================================================================
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/Makefile   Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,66 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/08/02 03:59:21 schmonz Exp $
+#
+
+DISTNAME=              qmail-run-20040801
+CATEGORIES=            mail
+MASTER_SITES=          # empty
+DISTFILES=             # empty
+
+MAINTAINER=            schmonz%NetBSD.org@localhost
+COMMENT=               Configures qmail to receive and deliver mail
+
+DEPENDS_QMAIL=         {qmail>=1.03nb8,netqmail>=1.05nb1}:../../mail/qmail
+DEPENDS+=              ${DEPENDS_QMAIL}
+.if !exists(/usr/sbin/mailwrapper)
+DEPENDS+=              mailwrapper-[0-9]*:../../mail/mailwrapper
+.endif
+.if !exists(/etc/rc.subr)
+DEPENDS+=              rc.subr-[0-9]*:../../pkgtools/rc.subr
+.endif
+
+PKG_INSTALLATION_TYPES=        overwrite pkgviews
+
+WRKSRC=                        ${WRKDIR}
+NO_CHECKSUM=           # defined
+
+USE_PKGINSTALL=                yes
+INSTALL_EXTRA_TMPL+=   ${.CURDIR}/INSTALL
+FILES_SUBST+=          QMAIL_QUEUE_EXTRA=${QMAIL_QUEUE_EXTRA}
+RCD_SCRIPTS=           qmail qmailqread qmailpop3d qmailsend qmailsmtpd
+
+INSTALLATION_DIRS=     bin share/doc/qmail-run share/examples/qmail-run
+
+.include "../../mk/bsd.prefs.mk"
+
+# Detect the PKG_SYSCONFDIR of the installed qmail or netqmail, so we
+# can create config files there and refer to them from rc.d scripts.
+.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
+INSTALLED_QMAIL!= \
+       dep=`${PKG_BEST_EXISTS} ${DEPENDS_QMAIL:C/:.*$//:Q:S/\ / /g}`;  \
+       case "$$dep" in                                                 \
+       "")     ${ECHO} "qmail_not_found_" ;;                           \
+       *)      ${ECHO} "$$dep" ;;                                      \
+       esac
+.  if empty(INSTALLED_QMAIL:M*_not_found_)
+.    if !defined(PKG_SYSCONFDIR.qmail-run)
+PKG_SYSCONFDIR.qmail-run!= \
+       ${PKG_INFO} -qB ${INSTALLED_QMAIL} |                            \
+               ${SED} -n '/^PKG_SYSCONFDIR=/s|^PKG_SYSCONFDIR=[        ]*||p'
+.    endif
+.  endif
+.endif
+
+do-build:
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/README.pkgsrc            \
+               > ${WRKDIR}/README.pkgsrc
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/mailer.conf              \
+               > ${WRKDIR}/mailer.conf
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail-qread-client.sh    \
+               > ${WRKDIR}/qmail-qread-client
+
+do-install:
+       ${INSTALL_SCRIPT} ${WRKDIR}/qmail-qread-client ${PREFIX}/bin
+       ${INSTALL_DATA} ${WRKDIR}/README.pkgsrc ${PREFIX}/share/doc/qmail-run
+       ${INSTALL_DATA} ${WRKDIR}/mailer.conf ${PREFIX}/share/examples/qmail-run
+
+.include "../../mk/bsd.pkg.mk"
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/PLIST      Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/08/02 03:59:21 schmonz Exp $
+bin/qmail-qread-client
+share/doc/qmail-run/README.pkgsrc
+share/examples/qmail-run/mailer.conf
+@dirrm share/examples/qmail-run
+@dirrm share/doc/qmail-run
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/files/README.pkgsrc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/files/README.pkgsrc        Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,44 @@
+ Getting help
+ ============
+
+You've installed an automated and customized qmail-run package. If
+you're having trouble getting the qmail daemons to run, ask the
+package's maintainer (<schmonz-nbqmail%schmonz.com@localhost>).
+
+While qmail includes installation instructions, many members of
+the qmail list instead recommend following Dave Sill's "Life with
+qmail" document:
+
+<URL:http://www.lifewithqmail.org/lwq.html>
+
+The qmail package you've installed follows LWQ in many aspects,
+but consciously deviates from it in others. Therefore, if you need
+to ask for help on the qmail list, please mention that you use the
+pkgsrc qmail-run package. If you can first reproduce your problem
+on a manual LWQ-style installation, your request for help is likely
+to be better received.
+
+It is highly recommended that you read Charles Cazabon's "12 Steps
+to qmail List Bliss" before posting to the list:
+
+<URL:http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html>
+
+
+ Deviations from LWQ
+ ===================
+
+LWQ suggests doing some things that the qmail package doesn't do:
+* Copying a script from /var/qmail/boot to /var/qmail/rc.
+* Configuring svscan(8) to run at boot.
+* Creating and/or populating /service.
+* Using supervise(8) and multilog(8).
+* Using the qmailctl script to control qmail.
+* Using the inst_check script to verify the installation.
+* Storing tcp.smtp{,cdb} in /etc.
+* Renaming the system sendmail(8) and marking it non-executable.
+
+Instead, to behave more like a typical pkgsrc package, the package:
+* Provides NetBSD-style rc.d scripts, including one very similar to qmailctl.
+* Sends log messages to syslog(3) by default.
+* Stores tcp.smtp{,cdb} and tcp.pop3{,cdb} in ${PKG_SYSCONFDIR}.
+* Uses mailwrapper(8) and mailer.conf(5).
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/files/mailer.conf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/files/mailer.conf  Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,10 @@
+#      $NetBSD: mailer.conf,v 1.1.1.1 2004/08/02 03:59:22 schmonz Exp $
+#
+# Use qmail as the system mailer.
+#
+sendmail       @LOCALBASE@/bin/sendmail
+send-mail      @LOCALBASE@/bin/sendmail
+mailq          @LOCALBASE@/bin/qmail-qread
+newaliases     @LOCALBASE@/bin/newaliases
+hoststat       @LOCALBASE@/bin/qmail-tcpto
+purgestat      @LOCALBASE@/bin/qmail-tcpok
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/files/qmail-qread-client.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/files/qmail-qread-client.sh        Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,7 @@
+#!@SH@
+#
+# Client program to allow local non-root users to see the queue.
+# Requires that the corresponding server program be running. From
+# Steinar Haug.
+
+exec @LOCALBASE@/bin/tcpclient -RHl0 -- 127.0.0.1 20025 @SH@ -c 'exec @CAT@ <&6'
diff -r 528afc14e43d -r 50da9ba6c945 mail/qmail-run/files/qmail.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-run/files/qmail.sh     Mon Aug 02 03:59:21 2004 +0000
@@ -0,0 +1,90 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: qmail.sh,v 1.1.1.1 2004/08/02 03:59:22 schmonz Exp $
+#
+# Master script for administrators to control qmail services.
+# Usage resembles the qmailctl script from "Life with qmail".
+#
+
+# KEYWORD: nostart
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+rcd_dir=`@DIRNAME@ $0`
+
+# NOTE: run_rc_command sets $rc_arg
+#
+forward_commands()
+{
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
+       for file in $COMMAND_LIST; do
+               $rcd_dir/$file $rc_arg
+       done
+}
+
+reverse_commands()
+{
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
+       REVCOMMAND_LIST=
+       for file in $COMMAND_LIST; do
+               REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+       done
+       for file in $REVCOMMAND_LIST; do
+               $rcd_dir/$file $rc_arg
+       done
+}
+
+qmailrcd()
+{
+       for service in $@; do
+               $rcd_dir/qmail${service} $rc_arg
+       done
+}
+
+qmail_help()
+{
+       @CAT@ <<HELP
+   stop -- stops mail service (smtp connections refused, nothing goes out)
+  start -- starts mail service (smtp connection accepted, mail can go out)
+  pause -- temporarily stops mail service (connections accepted, nothing leaves)
+   cont -- continues paused mail service
+   stat -- displays status of mail service
+    cdb -- rebuild the tcpserver cdb file for smtp and/or pop3
+restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
+doqueue -- schedules queued messages for immediate delivery
+ reload -- sends qmail-send HUP, rereading locals and virtualdomains
+  queue -- shows status of queue
+   alrm -- same as doqueue
+  flush -- same as doqueue
+    hup -- same as reload



Home | Main Index | Thread Index | Old Index