aboutsummaryrefslogtreecommitdiff
path: root/mail/milter-bogom
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-02-15 21:25:45 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-02-15 21:25:45 +0000
commita6e967fe32b1828cda43b0afbbee828c7ef01b3f (patch)
tree3b7806172a48a855ecb832b37f5f3043c5499583 /mail/milter-bogom
parent3b0a2d33853ddaf2a11aa644c0fdf3a4c6d6a7f5 (diff)
downloadports-a6e967fe32b1828cda43b0afbbee828c7ef01b3f.tar.gz
ports-a6e967fe32b1828cda43b0afbbee828c7ef01b3f.zip
Notes
Diffstat (limited to 'mail/milter-bogom')
-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
5 files changed, 111 insertions, 0 deletions
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