aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2005-02-16 05:25:45 +0800
committerpav <pav@FreeBSD.org>2005-02-16 05:25:45 +0800
commit82a19759ab2fbd7d936d9a583c813cd7ed0f9a56 (patch)
tree350e27f40546ee02e7366b2a7cbaf54175d115ef /mail
parent0a9baaa10d272059f790be33585da070e0e52ef2 (diff)
downloadfreebsd-ports-gnome-82a19759ab2fbd7d936d9a583c813cd7ed0f9a56.tar.gz
freebsd-ports-gnome-82a19759ab2fbd7d936d9a583c813cd7ed0f9a56.tar.zst
freebsd-ports-gnome-82a19759ab2fbd7d936d9a583c813cd7ed0f9a56.zip
Sendmail milter to interface with bogofilter
PR: ports/77472 Submitted by: Victor Balada Diaz <victor@alf.dyndns.ws>
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile1
-rw-r--r--mail/milter-bogom/Makefile47
-rw-r--r--mail/milter-bogom/distinfo2
-rw-r--r--mail/milter-bogom/files/milter-bogom.sh22
-rw-r--r--mail/milter-bogom/pkg-descr5
-rw-r--r--mail/milter-bogom/pkg-req35
6 files changed, 112 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index 31d16622b4e7..8b631aefdb5e 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -195,6 +195,7 @@
SUBDIR += mew3
SUBDIR += mew3-emacs20
SUBDIR += mew3-xemacs21-mule
+ SUBDIR += milter-bogom
SUBDIR += milter-greylist
SUBDIR += milter-greylist-devel
SUBDIR += milter-regex
diff --git a/mail/milter-bogom/Makefile b/mail/milter-bogom/Makefile
new file mode 100644
index 000000000000..cec0284f613e
--- /dev/null
+++ b/mail/milter-bogom/Makefile
@@ -0,0 +1,47 @@
+# New ports collection makefile for: milter-bogom
+# Date created: 12 Feb 2005
+# Whom: Victor Balada Diaz <victor@alf.dyndns.ws>
+#
+# $FreeBSD$
+#
+
+PORTNAME= milter-bogom
+PORTVERSION= 1.5.1
+CATEGORIES= mail
+MASTER_SITES= http://www.usebox.net/jjm/bogom/
+DISTNAME= bogom-${PORTVERSION}
+
+MAINTAINER= victor@alf.dyndns.ws
+COMMENT= Simple sendmail milter to interface bogofilter
+
+RUN_DEPENDS= bogofilter:${PORTSDIR}/mail/bogofilter
+
+MAN8= bogom.8
+
+PLIST_FILES= sbin/bogom \
+ etc/bogom.conf-example \
+ etc/rc.d/milter-bogom.sh
+PORTDOCS= README CHANGELOG
+
+post-extract:
+ @${SED} -e 's/LIBS+=-lmilter -lpthread/LIBS+=-lmilter ${PTHREAD_LIBS}/'\
+ -i .bak ${WRKSRC}/Makefile
+ @${SED} -e 's|/etc/bogom.conf|${PREFIX}/etc/bogom.conf|' -i .bak \
+ ${WRKSRC}/milter.c
+
+do-install:
+ @${INSTALL_PROGRAM} ${WRKSRC}/bogom ${PREFIX}/sbin
+ @${INSTALL_MAN} ${WRKSRC}/bogom.8 ${PREFIX}/man/man8
+ @${INSTALL_DATA} ${WRKSRC}/bogom.conf-example ${PREFIX}/etc
+ @${INSTALL_SCRIPT} ${FILESDIR}/milter-bogom.sh ${PREFIX}/etc/rc.d
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+ @${INSTALL_DATA} ${WRKSRC}/CHANGELOG ${DOCSDIR}
+.endif
+
+post-install:
+ @${SED} -e 's|LOCALBASE|${PREFIX}|g' -i "" \
+ ${PREFIX}/etc/rc.d/milter-bogom.sh
+
+.include <bsd.port.mk>
diff --git a/mail/milter-bogom/distinfo b/mail/milter-bogom/distinfo
new file mode 100644
index 000000000000..a8955c83f8e5
--- /dev/null
+++ b/mail/milter-bogom/distinfo
@@ -0,0 +1,2 @@
+MD5 (bogom-1.5.1.tar.gz) = 9dc9fc890819e22df3408b8a39837606
+SIZE (bogom-1.5.1.tar.gz) = 16868
diff --git a/mail/milter-bogom/files/milter-bogom.sh b/mail/milter-bogom/files/milter-bogom.sh
new file mode 100644
index 000000000000..6e3a96cdcc8e
--- /dev/null
+++ b/mail/milter-bogom/files/milter-bogom.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+case "$1" in
+ start)
+ if [ -f LOCALBASE/sbin/bogom ]
+ then
+ LOCALBASE/sbin/bogom -u root & > /dev/null
+ echo -n ' milter-bogom'
+ fi
+ ;;
+ stop)
+ killall bogom
+ sleep 3 # wait for bogom to exit
+ ;;
+
+ *)
+ echo ""
+ echo "Usage: `basename $0` { start | stop }"
+ echo ""
+ ;;
+esac
+exit 0;
diff --git a/mail/milter-bogom/pkg-descr b/mail/milter-bogom/pkg-descr
new file mode 100644
index 000000000000..f211ed29a15a
--- /dev/null
+++ b/mail/milter-bogom/pkg-descr
@@ -0,0 +1,5 @@
+The bogom plugin can be used with the milter API of sendmail to filter
+mails using bogofilter bayesian filter. It is intended to be used with
+only one words database for the whole system.
+
+WWW: http://www.usebox.net/jjm/bogom/
diff --git a/mail/milter-bogom/pkg-req b/mail/milter-bogom/pkg-req
new file mode 100644
index 000000000000..d4abc3717611
--- /dev/null
+++ b/mail/milter-bogom/pkg-req
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+need_milter() {
+
+echo "****************************************************************"
+echo "* You need at least the version 8.13 of sendmail compiled with *"
+echo "* milter support enabled. *"
+echo "****************************************************************"
+exit 1;
+
+}
+
+# check if we are not installing
+if [ "$2" != "INSTALL" ];
+then
+ exit 0;
+fi
+
+# check if sendmail have the MILTER API
+sendmail -d0.1 -bv root 2>&1 | grep MILTER > /dev/null
+
+if [ $? != 0 ];
+then
+ need_milter;
+fi
+
+# Check if sendmail is at least 8.13
+sendmail -d0.1 -bv root 2>& 1 | grep Version | awk '{ if ( $2 > "8.13" )\
+exit 0; else exit 1;}'
+
+if [ $? != 0 ];
+then
+ need_milter;
+fi
+exit 0