pkgsrc-Changes archive

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

CVS commit: pkgsrc/mail/qmail-run



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Wed May 31 07:08:05 UTC 2017

Modified Files:
        pkgsrc/mail/qmail-run: MESSAGE Makefile PLIST
        pkgsrc/mail/qmail-run/files: qmail-qfilter-queue.sh

Log Message:
Add dependency on qmail-qfilter. Deprecate qmail-qfilter-queue in favor
of qmail-qfilter-{ofmipd,smtpd}-queue, and document how to enable
filtering for incoming and submitted messages. Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/mail/qmail-run/MESSAGE
cvs rdiff -u -r1.35 -r1.36 pkgsrc/mail/qmail-run/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/mail/qmail-run/PLIST
cvs rdiff -u -r1.5 -r1.6 pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mail/qmail-run/MESSAGE
diff -u pkgsrc/mail/qmail-run/MESSAGE:1.4 pkgsrc/mail/qmail-run/MESSAGE:1.5
--- pkgsrc/mail/qmail-run/MESSAGE:1.4   Mon Jan  9 04:58:09 2017
+++ pkgsrc/mail/qmail-run/MESSAGE       Wed May 31 07:08:04 2017
@@ -1,8 +1,11 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.4 2017/01/09 04:58:09 schmonz Exp $
+$NetBSD: MESSAGE,v 1.5 2017/05/31 07:08:04 schmonz Exp $
 
 Please read ${PREFIX}/share/doc/qmail-run/README.pkgsrc.
 
+NOTE: qmail-qfilter-queue is deprecated and will be removed in 2017Q3.
+Please migrate to qmail-qfilter-{ofmipd,smtpd}-queue.
+
 To enable qmail for...
 
 Local and outgoing deliveries:
@@ -24,8 +27,20 @@ Outgoing submissions with SMTP AUTH over
 POP3 (only for Maildirs):
 - Set qmailpop3d=YES in /etc/rc.conf.
 
-To make the queue visible to local non-root users:
+Local non-root users to see the queue:
 - Set qmailqread=YES in /etc/rc.conf.
 - Change the mailq entry in /etc/mailer.conf to qmail-qread-client.
 
+Filtering incoming messages arriving via SMTP:
+- Set QMAILQUEUE="${PREFIX}/bin/qmail-qfilter-smtpd-queue" in tcp.smtp.
+- Reload the cdb: /etc/rc.d/qmailsmtpd cdb
+- Consult qmail-qfilter(1) and see share/examples/qmail-qfilter.
+- Place executable filters named 'smtpd-*' in ${PKG_SYSCONFDIR}/filters.
+
+Filtering outgoing messages submitted via OFMIP:
+- Set QMAILQUEUE="${PREFIX}/bin/qmail-qfilter-ofmipd-queue" in tcp.ofmip.
+- Reload the cdb: /etc/rc.d/qmailofmipd cdb
+- Consult qmail-qfilter(1) and see share/examples/qmail-qfilter.
+- Place executable filters named 'ofmipd-*' in ${PKG_SYSCONFDIR}/filters.
+
 ===========================================================================

Index: pkgsrc/mail/qmail-run/Makefile
diff -u pkgsrc/mail/qmail-run/Makefile:1.35 pkgsrc/mail/qmail-run/Makefile:1.36
--- pkgsrc/mail/qmail-run/Makefile:1.35 Tue Apr 11 14:04:37 2017
+++ pkgsrc/mail/qmail-run/Makefile      Wed May 31 07:08:04 2017
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.35 2017/04/11 14:04:37 schmonz Exp $
+# $NetBSD: Makefile,v 1.36 2017/05/31 07:08:04 schmonz Exp $
 #
 
-DISTNAME=              qmail-run-20170411
+DISTNAME=              qmail-run-20170531
 CATEGORIES=            mail
 MASTER_SITES=          # empty
 DISTFILES=             # empty
@@ -12,8 +12,7 @@ LICENSE=              2-clause-bsd
 
 DEPENDS_QMAIL=         qmail>=1.03nb8:../../mail/qmail
 DEPENDS+=              ${DEPENDS_QMAIL}
-
-CONFLICTS+=            qmail-qfilter-1.5nb1
+DEPENDS+=              qmail-qfilter>1.5nb1:../../mail/qmail-qfilter
 
 WRKSRC=                        ${WRKDIR}
 NO_BUILD=              yes
@@ -24,12 +23,12 @@ FILES_SUBST+=               QMAIL_LOG_USER=${QMAIL_LO
 FILES_SUBST+=          QMAIL_SEND_USER=${QMAIL_SEND_USER:Q}
 FILES_SUBST+=          QMAIL_QUEUE_EXTRA=${QMAIL_QUEUE_EXTRA:Q}
 FILES_SUBST+=          PKGNAME=${PKGNAME:Q}
-MESSAGE_SUBST+=                PKG_SYSCONFBASE=${PKG_SYSCONFBASE}
+MESSAGE_SUBST+=                PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q}
 RCD_SCRIPTS=           qmail qmailofmipd qmailpop3d qmailqread qmailsend qmailsmtpd
 
 INSTALLATION_DIRS=     bin share/doc/qmail-run share/examples/qmail-run
 BUILD_DEFS+=           QMAIL_DAEMON_USER QMAIL_LOG_USER QMAIL_SEND_USER
-BUILD_DEFS+=           QMAIL_QUEUE_EXTRA
+BUILD_DEFS+=           QMAIL_QUEUE_EXTRA PKG_SYSCONFBASE
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -71,9 +70,12 @@ post-extract:
        done
 
 do-install:
-       ${INSTALL_SCRIPT} ${WRKDIR}/qmail-procmail ${DESTDIR}${PREFIX}/bin
-       ${INSTALL_SCRIPT} ${WRKDIR}/qmail-qfilter-queue ${DESTDIR}${PREFIX}/bin
-       ${INSTALL_SCRIPT} ${WRKDIR}/qmail-qread-client ${DESTDIR}${PREFIX}/bin
+       for f in qmail-procmail qmail-qfilter-queue qmail-qread-client; do \
+           ${INSTALL_SCRIPT} ${WRKDIR}/$$f ${DESTDIR}${PREFIX}/bin;    \
+       done
+       for f in qmail-qfilter-ofmipd-queue qmail-qfilter-smtpd-queue; do \
+           ${INSTALL_SCRIPT} ${WRKDIR}/qmail-qfilter-queue ${DESTDIR}${PREFIX}/bin/$$f;        \
+       done
        ${INSTALL_DATA} ${WRKDIR}/README.pkgsrc \
                ${DESTDIR}${PREFIX}/share/doc/qmail-run
        ${INSTALL_DATA} ${WRKDIR}/mailer.conf \

Index: pkgsrc/mail/qmail-run/PLIST
diff -u pkgsrc/mail/qmail-run/PLIST:1.7 pkgsrc/mail/qmail-run/PLIST:1.8
--- pkgsrc/mail/qmail-run/PLIST:1.7     Mon Jan  9 04:58:09 2017
+++ pkgsrc/mail/qmail-run/PLIST Wed May 31 07:08:04 2017
@@ -1,6 +1,8 @@
-@comment $NetBSD: PLIST,v 1.7 2017/01/09 04:58:09 schmonz Exp $
+@comment $NetBSD: PLIST,v 1.8 2017/05/31 07:08:04 schmonz Exp $
 bin/qmail-procmail
+bin/qmail-qfilter-ofmipd-queue
 bin/qmail-qfilter-queue
+bin/qmail-qfilter-smtpd-queue
 bin/qmail-qread-client
 share/doc/qmail-run/README.pkgsrc
 share/examples/qmail-run/mailer.conf

Index: pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh
diff -u pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh:1.5 pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh:1.6
--- pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh:1.5      Wed Nov 25 12:51:30 2015
+++ pkgsrc/mail/qmail-run/files/qmail-qfilter-queue.sh  Wed May 31 07:08:04 2017
@@ -5,31 +5,61 @@
 #
 # Using this wrapper, executable filters:
 # * Must be placed in @PKG_SYSCONFDIR@/filters
-# * Must have filenames matching "qfilter-*"
+# * Must have filenames matching "ofmipd-*" or "smtpd-*"
 # * Will be executed with no arguments
 # * Will be executed in sort(1) order
-#
-# To use this script to filter messages arriving via SMTP, set the
-# QMAILQUEUE environment variable in tcp.smtp like so:
-#
-# :allow,QMAILQUEUE="@PREFIX@/bin/qmail-qfilter-queue"
-#
-# Then rebuild the cdb.
-
-possible_qfilters=`@ECHO@ @PKG_SYSCONFDIR@/filters/qfilter-* | @SORT@`
-qfilters=""
-
-if [ "${possible_qfilters}" = "@PKG_SYSCONFDIR@/filters/qfilter-*" ]; then
-       qfilters="@CAT@"
-else
-       for qfilter in ${possible_qfilters}; do
-               if [ -x "${qfilter}" ]; then
-                       qfilters="${qfilters} ${qfilter}"
-               fi
-       done
-       [ -z "${qfilters}" ] && qfilters="@CAT@"
-fi
 
-qfilter_cmd="@PREFIX@/bin/qmail-qfilter `@ECHO@ ${qfilters} | @SED@ -e 's| | -- |g'`"
+CAT=@CAT@
+ECHO=@ECHO@
+PKG_SYSCONFDIR=@PKG_SYSCONFDIR@
+PREFIX=@PREFIX@
+SED=@SED@
+SORT=@SORT@
 
-exec ${qfilter_cmd}
+warn() {
+       ${ECHO} >&2 "$@"
+}
+
+choose_glob() {
+       local _progname _glob
+       _progname="$1"
+       case "${_progname}" in
+       qmail-qfilter-ofmipd-queue)     _glob='ofmipd-*'        ;;
+       qmail-qfilter-smtpd-queue)      _glob='smtpd-*'         ;;
+       qmail-qfilter-queue)            _glob='qfilter-*'       ;;
+       esac
+       ${ECHO} "${_glob}"
+}
+
+choose_filters() {
+       local _glob _filters _possible_filters _filter
+       _glob="$1"
+       _possible_filters=$(${ECHO} ${PKG_SYSCONFDIR}/filters/${_glob} | ${SORT})
+       if [ "${_possible_filters}" = "${PKG_SYSCONFDIR}/filters/${_glob}" ]; then
+               _filters="${CAT}"
+       else
+               for _filter in ${_possible_filters}; do
+                       [ -x "${_filter}" ] && _filters="${_filters} ${_filter}"
+               done
+               [ -z "${_filters}" ] && _filters="${CAT}"
+       fi
+       ${ECHO} "${_filters}"
+}
+
+qfilter_args() {
+       local _filters
+       _filters="$1"
+       ${ECHO} ${_filters} | ${SED} -e 's| | -- |g'
+}
+
+main() {
+       local _progname _glob _filters _args _cmd
+       _progname=$(basename "$0")
+       _glob=$(choose_glob "${_progname}")
+       _filters=$(choose_filters "${_glob}")
+       _args=$(qfilter_args "${_filters}")
+       _cmd="${PREFIX}/bin/qmail-qfilter ${_args}"
+       exec ${_cmd}
+}
+
+main "$@"



Home | Main Index | Thread Index | Old Index