Gnus development mailing list
 help / color / mirror / Atom feed
From: Hirotaka Honda <hirotaka@hondalaw.com>
To: ding@gnus.org
Subject: Re: spam-split of spam.el with bsfilter
Date: Sat, 10 Apr 2021 19:50:26 +0900	[thread overview]
Message-ID: <m2o8eme7m5.fsf@hondalaw.com> (raw)
In-Reply-To: <m2y2l3p0lz.fsf@hondalaw.com> (Hirotaka Honda's message of "Tue, 22 Sep 2020 01:15:35 +0900")

Dear all

spam-split function began to work after putting the name of the spam folder also in the argument of the function.

   (: spam-split "mail.spam")  ;; "mail.spam"

Best regards,

Hirotaka Honda
Honda Law Office
ParkAxis ShibuyaSakuragaoka South 801
8-11  Sakuragaokacho, Shibuya-Ku
Tokyo 150-0031 Japan
Tel +81 3 3463 6602 Fax +81 3 3463 6608
http://www.hondalaw.com

        
Hirotaka Honda <hirotaka@hondalaw.com> writes:

> Dear all
>
> I have been using nnmail-split-fancy as nnmail-split-methods with spam-split function on Emacs 24.5.1. It worked very well.
>
> After I changed my computer, installed Emacs 27.1 with Gnus v5.13, and compiled bogofilter, I could not make bogofilter work for spam-split (somehow, I could get values by S t in summery buffer), however long time I examined.
>
> Luckily I found that bsfilter seems supported by spam.el.
> bsfilter is able to handle spams in Japanese.
>
> Environment
> Previous (x86_64-apple-darwin15.3.0, NS apple-appkit-1404.34) of 2016-02-28 on my MacOS
> Current (build 1, x86_64-apple-darwin19.6.0, Carbon Version 162 AppKit 1894.6) of 2020-09-06
>
> Problem 1
> spam-split function seems sending mail text to bsfilter. But even when it replies "X-Spam-Flag: Yes", it will not send it to the folder specified by the value spam-split-group.
>
> I made a script, bsfilter-test, which confirmed the problem.
>
> Probelem 2
> When I try spam-generic-score at summery buffer by keys S t, I always get the message "Spamicity score 0" even if the message tested was evaluated as spam by bogofilter on the command line of shell.
>
> I would be grateful if someone gives me any clues or hints to solve the problems.
>
> ;;;; init file settings relating to spam.el is as the following:
> (require 'spam)
> (spam-initialize)
>
> (setq spam-junk-mailgroups '("mail.spam"))
> (setq gnus-spam-process-destinations '(("nnml:.*" "nnml:mail.spam"))
> 	  gnus-ham-process-destinations '(("nnml:mail.spam" "nnml:mail.misc")))
> (setq spam-split-group '("mail.spam")) ;; nnml:xx wrong  9.17.2 Filtering Incoming Mail
> (setq spam-mark-ham-unread-before-move-from-spam-group t) ;; Manual
>
> (setq spam-bogofilter-program "/opt/local/bin/bogofilter")
> (setq spam-bogofilter-database-directory "/Users/hirotaka/.bogofilter") ;; right
>
> (setq spam-bsfilter-program "/Users/hirotaka/Applications/bin/bsfilter-test")
> (setq spam-use-bsfilter t)
> (setq spam-bsfilter-database-directory "/Users/hirotaka/.bsfilter")
>
> (setq gnus-install-group-spam-parameters nil) ;; necessary?
>
> (setq gnus-spam-process-newsgroups
>       '(("nnml:.*" ((spam spam-use-bsfilter)
> 			(ham spam-use-bsfilter)))))
>
> (setq gnus-parameters
> 	  '( ("nnml:mail\\.spam"
>  		  (display . all)
> 		  (spam-contents gnus-group-spam-classification-spam)
> 		  (spam-process ((spam spam-use-bsfilter) (ham spam-use-bsfilter)))
> 		  (spam-process-destination . "nnml:mail.spam")
> 		  (ham-process-destination . "nnml:mail.misc")
> 		  (ham-marks (gnus-del-mark gnus-read-mark gnus-ticked-mark gnus-killed-mark))
> 		  (spam-bsfilter-database-directory . "/Users/hirotaka/.bsfilter"))
> 		 ("nnml:mail\\.misc"
>  		  (display . all)
> 		  (spam-contents gnus-group-spam-classification-ham)
> 		  (spam-process ((spam spam-use-bsfilter) (ham spam-use-bsfilter)))
> 		  (spam-process-destination . "nnml:mail.spam")
> 		  (ham-process-destination . "nnml:mail.misc")
> 		  (ham-marks (gnus-del-mark gnus-read-mark gnus-ticked-mark gnus-killed-mark))
> 		  (spam-marks (gnus-spam-mark))
> 		  (spam-bsfilter-database-directory . "/Users/hirotaka/.bsfilter"))
> 		 ("nnml:mail\\.hirotaka"
>  		  (display . all)
> 		  (spam-contents gnus-group-spam-classification-ham)
> 		  (spam-process ((spam spam-use-bsfilter) (ham spam-use-bsfilter)))
> 		  (spam-process-destination . "nnml:mail.spam")
> 		  (ham-process-destination . "nnml:mail.misc")
> 		  (ham-marks (gnus-del-mark gnus-read-mark gnus-ticked-mark gnus-killed-mark))
> 		  (spam-marks (gnus-spam-mark))
> 		  (spam-bsfilter-database-directory . "/Users/hirotaka/.bsfilter"))))
>
> ;;;; bsfilter-test is as the following:
> #!/opt/local/bin/bash
> LOG=$HOME/tmp/bsfilter-spamel-log
> FARGV=("$@")
> FARGC=("$#")
> TARGV=()
> for ((i=0; i< $FARGC ;i++)){
> 	TARGV[i]=`echo ${FARGV[i]} | nkf -w`
> 	echo $i ${FARGV[i]} ":" ${TARGV[i]} >> $LOG
> 	}
> nkf -w | bsfilter ${TARGV[0]} ${TARGV[1]} ${TARGV[2]} ${TARGV[3]} ${TARGV[4]} ${TARGV[5]} ${TARGV[6]} ${TARGV[7]} ${TARGV[8]} ${TARGV[9]} ${TARGV[10]} ${TARGV[11]} ${TARGV[12]} | tee -a $LOG
> # nkf -w: nkf is a tool to convert coding. -w option means output UTF-8


  parent reply	other threads:[~2021-04-10 10:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 16:15 Hirotaka Honda
2020-09-22  1:55 ` 黃炳熙
2020-09-22  2:09   ` Emanuel Berg
2020-09-23  0:48     ` 黃炳熙
2020-09-23  1:01       ` Emanuel Berg
2020-09-23  2:30         ` 黃炳熙
2021-04-10 10:50 ` Hirotaka Honda [this message]
2021-04-10 13:30   ` Emanuel Berg
2021-04-11 11:10     ` Hirotaka Honda
2021-04-11 11:16       ` Emanuel Berg
2021-05-27 13:48       ` Mail source failed, wrong-type-argument integer-or-marker-p nil Hirotaka Honda
2021-05-27 15:59         ` Eric Abrahamsen
2021-05-27 16:49           ` Hirotaka Honda
2021-05-27 16:53             ` Eric Abrahamsen
2021-05-27 21:30               ` Hirotaka Honda
2021-05-28 17:29                 ` Eric Abrahamsen
2021-05-28  2:40           ` Pankaj Jangid
2021-05-28 23:05             ` Andy Moreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2o8eme7m5.fsf@hondalaw.com \
    --to=hirotaka@hondalaw.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).