aboutsummaryrefslogtreecommitdiff
path: root/mail/bogofilter
diff options
context:
space:
mode:
authorW. Michael Petullo <mike@flyn.org>2016-06-12 15:49:54 -0400
committerW. Michael Petullo <mike@flyn.org>2016-06-12 15:49:54 -0400
commit824532baf1c32181954cf1b63833b429ec71621c (patch)
treef08ea6db72de0e728b57742022d754a590aa22ec /mail/bogofilter
parent50c0c19ceb630c5e4bdca762e8b33cd4ce3fb7ff (diff)
bogofilter: postfix script now reads bogofilter_dir from bogofilter conf
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Diffstat (limited to 'mail/bogofilter')
-rw-r--r--mail/bogofilter/Makefile2
-rwxr-xr-xmail/bogofilter/files/postfix-bogofilter13
2 files changed, 12 insertions, 3 deletions
diff --git a/mail/bogofilter/Makefile b/mail/bogofilter/Makefile
index d31dfa8c1..a33555947 100644
--- a/mail/bogofilter/Makefile
+++ b/mail/bogofilter/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bogofilter
PKG_VERSION:=1.2.4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
diff --git a/mail/bogofilter/files/postfix-bogofilter b/mail/bogofilter/files/postfix-bogofilter
index 952d8cda3..284530912 100755
--- a/mail/bogofilter/files/postfix-bogofilter
+++ b/mail/bogofilter/files/postfix-bogofilter
@@ -1,7 +1,10 @@
#!/bin/sh
FILTER=/usr/bin/bogofilter
-FILTER_DIR=/mnt/sda1/var/spool/bogofilter
+
+# Attempt to read from bogofilter configuration.
+FILTER_DIR=$(cat /etc/bogofilter.cf | sed 's/#.*//g' | grep ^bogofilter_dir | awk -F = '{ print $2 }')
+
# WARNING! The -i is crucial, else you may see
# messages truncated at the first period that is alone on a line
# (which can happen with several kinds of messages, particularly
@@ -12,7 +15,13 @@ FILTER_DIR=/mnt/sda1/var/spool/bogofilter
# misleading traces in headers, such as local address
# canonicalizations.
POSTFIX="/usr/sbin/sendmail -G -i"
-export BOGOFILTER_DIR=/etc/bogofilter
+
+# No bogofilter_dir set in /etc/bogofilter.cf; fall back on directory
+# which persists across reboots.
+if [ -z "$FILTER_DIR" ]; then
+ FILTER_DIR=/etc/bogofilter
+ export BOGOFILTER_DIR=$FILTER_DIR
+fi
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75