# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # mail/bmf/ # mail/bmf/pkg-plist # mail/bmf/pkg-descr # mail/bmf/distinfo # mail/bmf/Makefile # mail/bmf/pkg-message # mail/bmf/files # mail/bmf/files/patch-Makefile.in # echo c - mail/bmf/ mkdir -p mail/bmf/ > /dev/null 2>&1 echo x - mail/bmf/pkg-plist sed 's/^X//' >mail/bmf/pkg-plist << 'END-of-mail/bmf/pkg-plist' Xbin/bmf Xbin/bmfconv Xshare/bmf/README X@dirrm share/bmf END-of-mail/bmf/pkg-plist echo x - mail/bmf/pkg-descr sed 's/^X//' >mail/bmf/pkg-descr << 'END-of-mail/bmf/pkg-descr' Xbmf is an extremely efficient Bayesian mail filter based on XPaul Graham's article, "A Plan for Spam." It's fast, small, Xefficient, and more versatile than other Bayesian filters. X X-- bmf-user@lists.sourceforge.net X XWWW: http://sourceforge.net/projects/bmf END-of-mail/bmf/pkg-descr echo x - mail/bmf/distinfo sed 's/^X//' >mail/bmf/distinfo << 'END-of-mail/bmf/distinfo' XMD5 (bmf-0.9.4.tar.gz) = 9cf55df2fa3a05bdc55ba7b0a129591e END-of-mail/bmf/distinfo echo x - mail/bmf/Makefile sed 's/^X//' >mail/bmf/Makefile << 'END-of-mail/bmf/Makefile' X# New ports collection makefile for: bmf X# Date created: 15 March 2003 X# Whom: Sean Chittenden X# X# $FreeBSD$ X# X XPORTNAME= bmf XPORTVERSION= 0.9.4 XCATEGORIES= mail XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X XMAINTAINER= seanc@FreeBSD.org XCOMMENT= A fast Bayesian Mail Filter compatible with maildrop and procmail X X.if defined(WITH_BDB41) XLIB_DEPENDS= db41.1:${PORTSDIR}/databases/db41 X.elif defined(WITH_BDB4) XLIB_DEPENDS= db4.0:${PORTSDIR}/databases/db4 X.else XLIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3 X.endif X XHAS_CONFIGURE= yes XCONFIGURE_ARGS+= --without-package X X.if defined(WITH_DEBUG) XCONFIGURE_ARGS+= --debug=yes X.endif X XMAN1= bmf.1 bmfconv.1 X Xpre-everything:: X @${ECHO} "" X @${ECHO} "${PORTNAME} has several tunables available:" X @${ECHO} "" X @${ECHO} " WITH_BDB4 Builds with BDB4 support" X @${ECHO} " WITH_BDB41 Builds with BDB4.1 support" X @${ECHO} " WITH_DEBUG Builds with debugging arguments" X @${ECHO} " WITH_MYSQL Builds with MySQL support" X @${ECHO} "" X @${ECHO} " Note: the default database is BDB3" X @${ECHO} "" X Xpost-install: X @ ${MKDIR} ${PREFIX}/share/bmf X @ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/bmf X @ ${CAT} ${PKGDIR}/pkg-message X X.include END-of-mail/bmf/Makefile echo x - mail/bmf/pkg-message sed 's/^X//' >mail/bmf/pkg-message << 'END-of-mail/bmf/pkg-message' X============================ X=== How to integrate bmf === X============================ X XFor maildrop(1), use only one of the following examples. The first Xsample invokes bmf in its normal mode of operation and the second Xinvokes bmf as a filter: X X ### Sample One X # Invoke bmf and use return code to filter spam in one step X exception { X `bmf` X if ( $RETURNCODE == 0 ) X to $MAILDIR/spam X } X X ### Sample Two X # Invoke bmf as a filter X exception { X xfilter "bmf -p" X if (/^X-Stam-Status: Yes/) X to $MAILDIR/spam X } X X XFor procmail(1), use only one of the following samples. SPAM will be Xfiltered into $MAILDIR/spam. The first sample invokes bmf in its Xnormal mode of operation and the second invokes bmf as a filter. X X ### begin sample one ### X # Invoke bmf and use return code to filter spam in one step X :0HB X * ? bmf X | formail -A"X-Spam-Status: Yes, tests=bmf" >>$MAILDIR/spam X X ### begin sample two ### X # Invoke bmf as a filter X :0 fw X | bmf -p X X # Filter spam X :0: X ^X-Spam-Status: Yes X $MAILDIR/spam X XIf you put bmf in your maildrop or procmail scripts as suggested Xabove, it will always register an email as either spam or non-spam. XTo reverse this registration and train bmf, the following mutt macros Xmay be useful: X X macro index \ed "unset wait_key\nbmf -S\nset wait_key\n=spam\n" "Tags a given message as SPAM" X macro index \et "bmf -t\nset wait_key\n" "Tests a given message to see if it is SPAM" X macro index \eu "bmf -N\nset wait_key\n=inbox\n" "Untags a given message as SPAM" X XThese will override these commands: X X d = de-register as non-spam, register as spam, and move to spam folder. X t = test for spamicity. X u = de-register as spam, register as non-spam, and move to inbox folder. X XPlease see the ${PREFIX}/share/bmf/README for further details. END-of-mail/bmf/pkg-message echo c - mail/bmf/files mkdir -p mail/bmf/files > /dev/null 2>&1 echo x - mail/bmf/files/patch-Makefile.in sed 's/^X//' >mail/bmf/files/patch-Makefile.in << 'END-of-mail/bmf/files/patch-Makefile.in' X--- Makefile.in.orig Sat Mar 15 13:35:31 2003 X+++ Makefile.in Sat Mar 15 13:36:05 2003 X@@ -1,7 +1,7 @@ X # Makefile for bmf X X-BINDIR=/usr/bin X-MANDIR=/usr/share/man X+BINDIR=${PREFIX}/bin X+MANDIR=${PREFIX}/man X X VERSION=0.9.4 X END-of-mail/bmf/files/patch-Makefile.in exit