Foren: users (Thread #24356)

pop proxy modeで新しいspamを追加する方法 (2009-10-26 12:45 by zenkato #46653)

bsfilter-1.0.17.rc4をmew-6.2.51でpop proxy modeで使用しています。
新しいspam mailをサマリーモードでls(learn spam)をして、spam folder
に入れていますが、次に到着したときにspamと判定されません。

マニュアルによると、
--popを使用している場合に無効なオプション
--pipe、及び、--add-clean等、学習に関するコマンド、オプションは無効である。
とあります。

どうやって新しいspamを追加したらいいのでしょうか?

Reply to #46653×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: pop proxy modeで新しいspamを追加する方法 (2009-10-26 13:21 by koie #46660)

わたしはこんなふうにせっていしてつかえています:
(setq mew-spam-prog "bsfilter")
(setq mew-spam-prog-args '("--update" "--add-spam" "--sub-clean"))
(setq mew-ham-prog "bsfilter")
(setq mew-ham-prog-args '("--update" "--add-clean" "--sub-spam"))
Reply to #46653

Reply to #46660×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: pop proxy modeで新しいspamを追加する方法 (2009-10-26 17:21 by zenkato #46663)

私も.mew.elに以下のように設定していますが、lsをしたのちspam folder SPAM2
に入れた後
$ bsfilter < ~/Mail/SPAM2/xxxx; echo $? とすると、1 (ham)が返ってきます。
これはこのspam mailに
X-Spam-Flag: No
X-Spam-Probability: 0.500000
がつけられたからでしょうか?
X-Spam-Flag: No をYesに変更すればいいのでしょうか? どうやったらいいので
しょうか?

~/.mew.el
;; bsfilter
;; $Id: mew.el,v 1.1 2009/04/30 16:50:26 nabeken Exp $

(setq mew-pop-proxy-server "localhost")
(setq mew-pop-proxy-port "10110")

; moved from .emacs.el
(setq mew-spam: "X-Spam-Flag:")

; put "D"
(defun mew-spam-bsfilter (val)
(let ((case-fold-search t))
(if (string-match "yes" val) ?D)))

; put "o +SPAM2" at inc
(defun mew-spam-bsfilter (val)
(let ((case-fold-search t))
(if (string-match "yes" val) "+SPAM2")))

(setq mew-inbox-action-alist
'(("X-Spam-Flag:" mew-spam-bsfilter)))

; for "ls" (learn-spam)
(setq mew-spam-prog "bsfilter")
(setq mew-spam-prog-args '("-C" "-s" "-u"))

; for "lh" (learn-ham)
(setq mew-ham-prog "bsfilter")
(setq mew-ham-prog-args '("-c" "-S" "-u"))

; for "bm" (mark-spam)
(define-key mew-summary-mode-map "bm" 'mew-summary-bsfilter-mark-region)

(defun mew-summary-bsfilter-mark-region (&optional arg)
"study/judge the region and put the '*' mark onto spams.
need to re-learn if judgment of bsfilter is wrong"
(interactive "P")
(mew-pickable
(mew-summary-with-mewl
(let* ((folder (mew-summary-physical-folder))
(msgs (mew-summary-pick-msgs folder t))
(prog "bsfilter")
(opts '("-a" "--list-spam"))
(pattern nil))
(setq msgs (mew-summary-pick-with-grep prog opts pattern folder msgs))
(mew-summary-pick-ls folder msgs)))))

; show X-Spam-Flag and X-Spam-Probability in message buffer
(setq mew-field-spec
(reverse (append (list (car (reverse mew-field-spec)))
'(("^X-Spam-Probability:$" t)
("^X-Spam-Flag:$" t))
(cdr (reverse mew-field-spec)))))

Reply to #46660

Reply to #46663×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: pop proxy modeで新しいspamを追加する方法 (2009-10-26 21:17 by koie #46665)

bsfilter --export-spam や bsfilter --export-clean でDBの中身を標準出力に出せるので
l s の後にカウントが上がっているかどうか確認してはどうでしょうか。
私の場合は l s を10回連続実行して強力にスパム認定させています。
Reply to #46663

Reply to #46665×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden