diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/bogofilter/bogofilter_0.96.0.bb | 8 | ||||
-rw-r--r-- | packages/bogofilter/files/bogohelper.sh | 12 |
2 files changed, 19 insertions, 1 deletions
diff --git a/packages/bogofilter/bogofilter_0.96.0.bb b/packages/bogofilter/bogofilter_0.96.0.bb index dcef43d2a6..f9859481f0 100644 --- a/packages/bogofilter/bogofilter_0.96.0.bb +++ b/packages/bogofilter/bogofilter_0.96.0.bb @@ -4,13 +4,14 @@ DESCRIPTION = "Bogofilter is a mail filter that classifies mail as spam or ham ( by a statistical analysis of the message's header and content (body). \ The program is able to learn from the user's classifications and corrections." LICENSE = "GPL" -PR = "r2" +PR = "r3" PRIORITY = "optional" SRC_URI = "http://download.sourceforge.net/bogofilter/bogofilter-${PV}.tar.bz2 \ file://${FILESDIR}/configure.ac.patch;patch=1 \ file://volatiles \ file://postfix-filter.sh \ + file://bogohelper.sh \ " inherit autotools @@ -21,11 +22,16 @@ do_install_append () { mkdir -p ${D}${sysconfdir}/default/volatiles install -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/01_bogofilter install -m 755 ${WORKDIR}/postfix-filter.sh ${D}${bindir}/postfix-filter.sh + install -m 755 ${WORKDIR}/bogohelper.sh ${D}${bindir}/bogohelper.sh } pkg_postinst () { grep filter /etc/group || addgroup filter grep spam /etc/passwd || adduser --disabled-password --home=/var/spool/filter --ingroup filter -g "Bogofilter" spam grep bogo /etc/passwd || adduser --disabled-password --home=/home/bogo --ingroup filter -g "Bogofilter" bogo + [ -f "/etc/postfix/master.cf" ] && grep "/usr/bin/postfix-filter.sh" /etc/postfix/master.cf || { + echo "bogofilter unix - n n - - pipe" >> /etc/postfix/master.cf + echo " flags=R user=bogo argv=/usr/bin/postfix-filter.sh -f ${sender} -- ${recipient}" >> /etc/postfix/master.cf + } /etc/init.d/populate-volatile.sh } diff --git a/packages/bogofilter/files/bogohelper.sh b/packages/bogofilter/files/bogohelper.sh new file mode 100644 index 0000000000..5be7aeae7e --- /dev/null +++ b/packages/bogofilter/files/bogohelper.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -d "$2" ] ; then + echo -e "\ncd $2" + cd "$2" + + for i in `find . -name '*.' -maxdepth 1` ; do + echo "bogofilter -d /opt/var/spool/bogofilter -t -v $1 < $i" + bogofilter -d /opt/var/spool/bogofilter -t -v "$1" < "$i" + done +fi + |