トップ 新規 編集 差分 一覧 ソース 検索 ヘルプ PDF RSS ログイン

bsfilter

bsfilter

bsfilter / bayesian spam filter / ベイジアン スパム フィルタ

Makefile

# New ports collection makefile for:    bsfilter
# Date created:         5 Oct 2003
# Whom:                 Masafumi Otsune <info@otsune.com>
#
# $FreeBSD$
#

PORTNAME=	bsfilter
PORTVERSION=	1.0.0
CATEGORIES=	mail ruby
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR=	bsfilter/8453
EXTRACT_SUFX=    .tgz

MAINTAINER=	info@otsune.com
COMMENT=	A bayesian spam filter written in Ruby

RUN_DEPENDS=	${RUBY_ARCHLIBDIR}/gdbm.so:${PORTSDIR}/databases/ruby-gdbm
.if defined(WITH_CHASEN)
RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/chasen.so:${PORTSDIR}/japanese/ruby-chasen
.endif
.if defined(WITH_KAKASI)
RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/kakasi.so:${PORTSDIR}/japanese/ruby-kakasi
.endif
.if defined(WITH_MECAB)
RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/MeCab.so:${PORTSDIR}/japanese/ruby-mecab
.endif

NO_BUILD=	yes
USE_RUBY=	yes
#RUBY_SHEBANG_FILES=	${DISTNAME}

pre-build:
	@${ECHO_MSG} "specify algorithm of a tokenizer for Japanese language"
	@${ECHO_MSG} "WITH_CHASE

2000N=yes (japanese/chasen)"

	@${ECHO_MSG} "WITH_KAKASI=yes (japanese/kakasi)"
	@${ECHO_MSG} "WITH_MECAB=yes (japanese/mecab)"

do-install:
	@${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${PREFIX}/bin/${PORTNAME}
.if !defined(NOPORTDOCS)
	@${MKDIR} ${EXAMPLESDIR}
.for FILE in bsfilter.conf.sample dot-qmail.sample
	@${INSTALL_DATA} ${FILESDIR}/${FILE} ${EXAMPLESDIR}
.endfor
.endif

.include <bsd.port.mk>

pkg-descr

bsfilter is a bayesian spam filter.

- English and Japanese are supported.
- Written in Ruby
- Three interfaces are supported.
-- Local mail file. accesses files or stdin/out.
-- IMAP. accesses mails in a IMAP server.
-- POP proxy. works as a proxy between a POP server and MUA.
- GPL

Author:	nabeken
WWW:	http://sourceforge.jp/projects/bsfilter/

pkg-message

Before actually using bsfilter, it is necessary to prepare databases.

1.count words in clean(good) mails.
% bsfilter --add-clean ~/Maildir/.cur/*
 or
% cd ~/Maildir/cur/ ; ls | xargs bsfilter -c

2.count words in spams.
% bsfilter --add-spam ~/Maildir/.spam/*
 or
% cd ~/Maildir/.spam/cur/ ; ls | xargs bsfilter -s

3.calculate clean/spam probability for each word
% bsfilter -u

files/bsfilter.conf.sample

## example of bsfilter.conf
jtokenizer kakasi # 'make WITH_KAKASI=yes install'
#jtokenizer MeCab # 'make WITH_MECAB=yes install'
spam-cutoff 0.6

## IMAP 
## (bsfilter --imap --imap-fetch-unflagged --insert-flag --insert-probability -- imap-folder-spam inbox.spam inbox)
#imap-server server.example.com
#imap-auth login
#imap-user alibaba
#imap-password open_sesame

## POP Proxy
## (bsfilter --pop --auto-update)
#pop-server server.example.com
#pop-proxy-port 10110
#pop-user alibaba
#insert-flag
#insert-probability

files/dot-qmail.sample

| /var/qmail/bin/condredirect MYADDRESS-spam@example.com bsfilter
./Maildir/

pkg-plist

bin/bsfilter
%%PORTDOCS%%share/examples/bsfilter/bsfilter.conf.sample
%%PORTDOCS%%share/examples/bsfilter/dot-qmail.sample
%%PORTDOCS%%@dirrm share/examples/bsfilter

distinfo

MD5 (bsfilter-1.0.0.tgz) = 741371bc88ffe66e503e88dbe2b3306e
SIZE (bsfilter-1.0.0.tgz) = 832896

最終更新時間:2008年04月13日 06時39分14秒