diff options
author | Sean Chittenden <seanc@FreeBSD.org> | 2003-03-24 05:07:52 +0000 |
---|---|---|
committer | Sean Chittenden <seanc@FreeBSD.org> | 2003-03-24 05:07:52 +0000 |
commit | c3141714682a0fbc46ef79c901eb06aa3f07c48e (patch) | |
tree | 7c5217a52dea56b8f79669ee7797f586580acef1 /mail | |
parent | Update net/mydns to 0.9.7 (diff) |
Add bmf: a fast (fastest filter I know of) Bayesian Mail Filter (adaptive
spam filter && has hooks for mutt!). Works well with maildrop, procmail,
and can be integrated with all known mailing list software.
Notes
Notes:
svn path=/head/; revision=77349
Diffstat (limited to 'mail')
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/bmf/Makefile | 51 | ||||
-rw-r--r-- | mail/bmf/distinfo | 1 | ||||
-rw-r--r-- | mail/bmf/files/patch-Makefile.in | 12 | ||||
-rw-r--r-- | mail/bmf/pkg-descr | 7 | ||||
-rw-r--r-- | mail/bmf/pkg-message | 61 | ||||
-rw-r--r-- | mail/bmf/pkg-plist | 4 |
7 files changed, 137 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index 423557b9c402..473e827f49d4 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -16,6 +16,7 @@ SUBDIR += bbmail SUBDIR += biabam SUBDIR += biffer + SUBDIR += bmf SUBDIR += bogofilter SUBDIR += bsmtp SUBDIR += bulk_mailer diff --git a/mail/bmf/Makefile b/mail/bmf/Makefile new file mode 100644 index 000000000000..3684b74f4fba --- /dev/null +++ b/mail/bmf/Makefile @@ -0,0 +1,51 @@ +# New ports collection makefile for: bmf +# Date created: 15 March 2003 +# Whom: Sean Chittenden <seanc@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= bmf +PORTVERSION= 0.9.4 +CATEGORIES= mail +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} + +MAINTAINER= seanc@FreeBSD.org +COMMENT= A fast Bayesian Mail Filter compatible with maildrop and procmail + +.if defined(WITH_BDB41) +LIB_DEPENDS= db41.1:${PORTSDIR}/databases/db41 +.elif defined(WITH_BDB4) +LIB_DEPENDS= db4.0:${PORTSDIR}/databases/db4 +.else +LIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3 +.endif + +HAS_CONFIGURE= yes +CONFIGURE_ARGS+= --without-package + +.if defined(WITH_DEBUG) +CONFIGURE_ARGS+= --debug=yes +.endif + +MAN1= bmf.1 bmfconv.1 + +pre-everything:: + @${ECHO} "" + @${ECHO} "${PORTNAME} has several tunables available:" + @${ECHO} "" + @${ECHO} " WITH_BDB4 Builds with BDB4 support" + @${ECHO} " WITH_BDB41 Builds with BDB4.1 support" + @${ECHO} " WITH_DEBUG Builds with debugging arguments" + @${ECHO} " WITH_MYSQL Builds with MySQL support" + @${ECHO} "" + @${ECHO} " Note: the default database is BDB3" + @${ECHO} "" + +post-install: + @ ${MKDIR} ${PREFIX}/share/bmf + @ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/bmf + @ ${CAT} ${PKGDIR}/pkg-message + +.include <bsd.port.mk> diff --git a/mail/bmf/distinfo b/mail/bmf/distinfo new file mode 100644 index 000000000000..d82eb5c6a159 --- /dev/null +++ b/mail/bmf/distinfo @@ -0,0 +1 @@ +MD5 (bmf-0.9.4.tar.gz) = 9cf55df2fa3a05bdc55ba7b0a129591e diff --git a/mail/bmf/files/patch-Makefile.in b/mail/bmf/files/patch-Makefile.in new file mode 100644 index 000000000000..d9981c1fe1a8 --- /dev/null +++ b/mail/bmf/files/patch-Makefile.in @@ -0,0 +1,12 @@ +--- Makefile.in.orig Sat Mar 15 13:35:31 2003 ++++ Makefile.in Sat Mar 15 13:36:05 2003 +@@ -1,7 +1,7 @@ + # Makefile for bmf + +-BINDIR=/usr/bin +-MANDIR=/usr/share/man ++BINDIR=${PREFIX}/bin ++MANDIR=${PREFIX}/man + + VERSION=0.9.4 + diff --git a/mail/bmf/pkg-descr b/mail/bmf/pkg-descr new file mode 100644 index 000000000000..8a14336822fd --- /dev/null +++ b/mail/bmf/pkg-descr @@ -0,0 +1,7 @@ +bmf is an extremely efficient Bayesian mail filter based on +Paul Graham's article, "A Plan for Spam." It's fast, small, +efficient, and more versatile than other Bayesian filters. + +-- bmf-user@lists.sourceforge.net + +WWW: http://sourceforge.net/projects/bmf diff --git a/mail/bmf/pkg-message b/mail/bmf/pkg-message new file mode 100644 index 000000000000..dc9640a5d76f --- /dev/null +++ b/mail/bmf/pkg-message @@ -0,0 +1,61 @@ +============================ +=== How to integrate bmf === +============================ + +For maildrop(1), use only one of the following examples. The first +sample invokes bmf in its normal mode of operation and the second +invokes bmf as a filter: + + ### Sample One + # Invoke bmf and use return code to filter spam in one step + exception { + `bmf` + if ( $RETURNCODE == 0 ) + to $MAILDIR/spam + } + + ### Sample Two + # Invoke bmf as a filter + exception { + xfilter "bmf -p" + if (/^X-Stam-Status: Yes/) + to $MAILDIR/spam + } + + +For procmail(1), use only one of the following samples. SPAM will be +filtered into $MAILDIR/spam. The first sample invokes bmf in its +normal mode of operation and the second invokes bmf as a filter. + + ### begin sample one ### + # Invoke bmf and use return code to filter spam in one step + :0HB + * ? bmf + | formail -A"X-Spam-Status: Yes, tests=bmf" >>$MAILDIR/spam + + ### begin sample two ### + # Invoke bmf as a filter + :0 fw + | bmf -p + + # Filter spam + :0: + ^X-Spam-Status: Yes + $MAILDIR/spam + +If you put bmf in your maildrop or procmail scripts as suggested +above, it will always register an email as either spam or non-spam. +To reverse this registration and train bmf, the following mutt macros +may be useful: + + macro index \ed "<enter-command>unset wait_key\n<pipe-entry>bmf -S\n<enter-command>set wait_key\n<save-message>=spam\n" "Tags a given message as SPAM" + macro index \et "<pipe-entry>bmf -t\n<enter-command>set wait_key\n" "Tests a given message to see if it is SPAM" + macro index \eu "<pipe-entry>bmf -N\n<enter-command>set wait_key\n<save-message>=inbox\n" "Untags a given message as SPAM" + +These will override these commands: + + <Esc>d = de-register as non-spam, register as spam, and move to spam folder. + <Esc>t = test for spamicity. + <Esc>u = de-register as spam, register as non-spam, and move to inbox folder. + +Please see the ${PREFIX}/share/bmf/README for further details. diff --git a/mail/bmf/pkg-plist b/mail/bmf/pkg-plist new file mode 100644 index 000000000000..c185fd8e64a0 --- /dev/null +++ b/mail/bmf/pkg-plist @@ -0,0 +1,4 @@ +bin/bmf +bin/bmfconv +share/bmf/README +@dirrm share/bmf |