From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62342 Path: news.gmane.org!not-for-mail From: "Ted Zlatanov" Newsgroups: gmane.emacs.gnus.general Subject: Re: spam handling in No Gnus 0.3 Date: 21 Mar 2006 11:06:43 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <4n8xr3dbos.fsf@asimov.bwh.harvard.edu> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1142957236 11912 80.91.229.2 (21 Mar 2006 16:07:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Mar 2006 16:07:16 +0000 (UTC) Cc: "Ding Mailing List" Original-X-From: ding-owner+m10869@lists.math.uh.edu Tue Mar 21 17:07:15 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FLjO0-0002QG-4R for ding-account@gmane.org; Tue, 21 Mar 2006 17:07:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FLjNu-0006YF-00; Tue, 21 Mar 2006 10:07:02 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FLjNg-0006Y7-00 for ding@lists.math.uh.edu; Tue, 21 Mar 2006 10:06:48 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FLjNd-0003j9-Ms for ding@lists.math.uh.edu; Tue, 21 Mar 2006 10:06:48 -0600 Original-Received: from clifford.bwh.harvard.edu ([134.174.9.41] helo=mail.bwh.harvard.edu) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FLjNd-0004LY-00 for ; Tue, 21 Mar 2006 17:06:45 +0100 Original-Received: (qmail 14556 invoked from network); 21 Mar 2006 15:59:35 -0000 Envelope-Sender: tzz@lifelogs.com Envelope-Recipients: ding@gnus.org, Original-Received: from asimov.bwh.harvard.edu ([134.174.54.119]) (envelope-sender ) by mail.bwh.harvard.edu (qmail-ldap-1.03) with SMTP for ; 21 Mar 2006 15:59:35 -0000 Mail-Followup-To: "Ding Mailing List" Original-Newsgroups: gnu.emacs.gnus X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:ckPGQq3VIFP5lRuE6lxFMI/jm90= In-Reply-To: (Alberto L.'s message of "Sun, 19 Mar 2006 10:29:28 -0800") Posted-To: gnu.emacs.gnus X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62342 Archived-At: The following message is a courtesy copy of an article that has been posted to gnu.emacs.gnus as well. On 19 Mar 2006, alberto.l@nospam.net wrote: > I have recently upgraded to No Gnus 0.3 and I have some comments about > spam handling. > > I use the nnfolder backend for e-mail, spam-split with bogofilter, and > gnus-registry. New messages classified as ham appear in > mail.incoming. If I find there spam, then I mark it as spam and, on > exiting, the message is registered as spam with bogofilter, and moved > to mail.spam.save. > > Later on I double check mail.spam.save (a > gnus-group-spam-classification-spam group), where I can mark ham > erroneously classified as spam. On exiting, spam is deleted, and ham > is unregistered as spam, and registered as ham with bogofilter. > > The first problem I find is that when spam messages are deleted from > mail.spam.save, they are UN-registered as spam with bogofilter, which > is obviously undesirable. > > I have checked the elisp code in spam.el. The summary-prepare-exit > hook routine checks what marks changed in mail.spam.save, and for each > article whone mark changed from spam to ham (AND viceversa), and was > registered as spam, it is unregistered as spam. The articles I marked > as spam have no mark when the group is entered, then they are > automatically marked as spam with a summary-prepare hook routine > (because the group is classified as spam). When checks are done on > exiting, all spam articles unchanged by the user are considered > "changed" because their mark was (automatically) changed. And, even > if the mark says "spam", they are unregistered as spam: this appears > plain wrong to me. > > It is quite easy to fix the above, one has to move > "spam-mark-junk-as-spam-routine" to before (rather than after) > initializing the "spam-old-articles" in the prepare-summary spam hook: > (defun spam-summary-prepare () (spam-mark-junk-as-spam-routine) (setq spam-old-articles (list (cons 'ham (spam-list-articles gnus-newsgroup-articles 'ham)) (cons 'spam (spam-list-articles gnus-newsgroup-articles 'spam))))) > I recommend adopting the above modification. The whole point of the order is that old articles are from before unseen articles got marked as spam. So I don't think this fix will do it. Could you use the CVS version of Gnus, and we can start thinking of a solution against it? > I use a second group mail.spam.train to train bogofilter both with ham > and spam messages. The group is "gnus-group-spam-classification-ham". > On exiting, articles marked as ham are registered as ham with > bogofilter. Articles marked as spam are registered as spam with > bogofilter and automatically moved to mail.spam.save. > > The problem is that ham articles are not moved or deleted, and when I > re-enter the group in order to expire the article (I have immediate > expiration) to avoid double registrations, on exiting the ham articles > are unregistered as ham, which is again quite undesirable. > > This happens because, in the summary-prepare-exit spam routine, the > expired articles have the "expirable" mark, which is not a ham mark, > thus the code judges that their classification has changed, and since > gnus-registry remembers they were registered as ham, they are > unregistered. Something similar happens if one explicitly expires > spam in spam groups. There are two possible solutions: > - add the expirable mark in the list of both ham and spam marks > - change the code, preventing expirable articles to be considered as > articles where the user changed their ham/spam classification. > > I think that the second solution is more appropriate: when I expire > articles I mean to delete them, and not to change their ham/spam > classification. In order to do that, spam.el has to be changed as > follows: > *************** *** 1343,1352 **** (dolist (backend (spam-backend-list)) (let (unregister-list) (dolist (article changed-articles) (let ((id (spam-fetch-field-message-id-fast article))) (when (spam-log-unregistration-needed-p id 'process classification backend) ! (push article unregister-list)))) ;; call spam-register-routine with specific articles to unregister, ;; when there are articles to unregister and the check is enabled (when (and unregister-list (symbol-value backend)) --- 1343,1355 ---- (dolist (backend (spam-backend-list)) (let (unregister-list) (dolist (article changed-articles) + ;; do not unregister articles marked as expirable + (unless (eq gnus-expirable-mark + (gnus-summary-article-mark article)) (let ((id (spam-fetch-field-message-id-fast article))) (when (spam-log-unregistration-needed-p id 'process classification backend) ! (push article unregister-list))))) ;; call spam-register-routine with specific articles to unregister, ;; when there are articles to unregister and the check is enabled (when (and unregister-list (symbol-value backend)) Expirable articles should probably be ignored, so I think this modification is OK. Does anyone else see a problem? Ted