[[FrontPage]]
// * bsfilter

* bsfilter

#contents

** 準備
* 準備

*** ~/.bsfilter/bsfilter.conf
** ~/.bsfilter/bsfilter.conf

 jtokenizer kakasi

とりあえず適当なものを指定してみる。

*** 学習
** 学習

 bsfilter --add-spam SPAM/*
 bsfilter --add-clean CLEAN/*
 bsfilter --update

** 判別
* 判別

 bsfilter && echo SPAM

後は標準入力に食わせるのみ

** 設定
* 設定

SPAMは受信頻度を下げるが1日に1度まとめて受信する方針

- bsfilterに通す
-- ヘッダに文字列追加
- SPAM
-- may_be_spamに移動
-- cronで通常のところに移動
- 通常メール
-- 普通に受信扱い

*** .procmailrc
** .procmailrc

	MAILDIR=$HOME/Maildir
	LOGFILE=$MAILDIR/log/procmail.log
	DEFAULT=$MAILDIR/
	SPAMDIR=$MAILDIR/may_be_spam/
	
	:0 fw
	| bsfilter --pipe --insert-flag --insert-probability
	
	#:0 HB
	#* ? bsfilter
	#$SPAMDIR
	
	:0
	* ^X-Spam-Flag: Yes
	$SPAMDIR
	
	:0
	$DEFAULT

- $HOME/Maildir/may_be_spam/ のところは / を最後に付けるときと付けないときで挙動が違う
-- 付けたときは new cur tmp が作られる
-- 付けないときは そのディレクトリ下に msg.HOGEなファイルが作られる

*** .forward
** .forward

 "|IFS=' ' && p=/usr/bin/procmail && test -f $p && exec $p -Yf- || exit 75 #riu"

*** crontab
** crontab

 0 0 * * * mv --reply=no ~/Maildir/may_be_spam/new/* ~/Maildir/new
 0 0 * * * mv --reply=no ~/Maildir/may_be_spam/new/* ~/Maildir/new 2> /dev/null

* 他

** thunderbirdのメールボックスを読ませる

 bsfilter --add-spam --mbox ~/.mozilla-thunderbird/〜/Mail/〜/SPAM

読込に失敗しているようなら上のファイルをどこかにコピーするなりして回避


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS