summaryrefslogtreecommitdiff
path: root/mail/qmail-qfilter/files/qmail-qfilter-queue.sh
diff options
context:
space:
mode:
authorschmonz <schmonz>2004-07-21 22:53:36 +0000
committerschmonz <schmonz>2004-07-21 22:53:36 +0000
commit21f1e6f2241a332ff467e70231a7fedf1a40cd0b (patch)
treee0932de0c402aea7bb61c816b7ff841be39ddd65 /mail/qmail-qfilter/files/qmail-qfilter-queue.sh
parent5e99ee7aa5593a8ee651fed2c991afe613f0b30d (diff)
downloadpkgsrc-21f1e6f2241a332ff467e70231a7fedf1a40cd0b.tar.gz
Use qmail-qfilter's installer, which wins us a manual page. Add
dependency on netqmail (but not qmail, as for pkgsrc purposes this requires the QMAILQUEUE patch). Enable pkgviews installation. Rename post-patch to do-configure, since that's what it's doing. Add a simple script that runs all the filters in ${PKG_SYSCONFDIR} whose filenames match "qfilter-*". Explain how to enable filtering on messages arriving via SMTP using this script. Take MAINTAINER. Bump PKGREVISION.
Diffstat (limited to 'mail/qmail-qfilter/files/qmail-qfilter-queue.sh')
-rw-r--r--mail/qmail-qfilter/files/qmail-qfilter-queue.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/mail/qmail-qfilter/files/qmail-qfilter-queue.sh b/mail/qmail-qfilter/files/qmail-qfilter-queue.sh
new file mode 100644
index 00000000000..9abbe7175fe
--- /dev/null
+++ b/mail/qmail-qfilter/files/qmail-qfilter-queue.sh
@@ -0,0 +1,28 @@
+#!@SH@
+#
+# Wrapper for qmail-queue that filters messages before injecting
+# into the queue.
+#
+# Using this wrapper, executable filters:
+# * Must be placed in @PKG_SYSCONFDIR@
+# * Must have filenames matching "qfilter-*"
+# * Will be executed with no arguments
+# * Will be executed in sort(1) order
+
+possible_qfilters=`@ECHO@ @PKG_SYSCONFDIR@/qfilter-* | @SORT@`
+qfilters=""
+
+if [ "${possible_qfilters}" = "@PKG_SYSCONFDIR@/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'`"
+
+exec ${qfilter_cmd}