info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to unregister message as spam/ham?


From: Adam Sjøgren
Subject: Re: How to unregister message as spam/ham?
Date: Sun, 06 Sep 2009 14:06:19 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.5-b29 (linux)

On Sun, 06 Sep 2009 13:50:46 +0200, Adam wrote:

> On Sun, 06 Sep 2009 12:42:51 +0200, Adam wrote:

>> Looking in the code, unregistering seems to be handled for bogofilter:

> Ah, it is - but an article isn't unregistered if it is going from ham to
> spam, or spam to ham, because, in spam.el's spam-resolve-registrations-routine
> this happens:

>          ;; eliminate duplicates

Here is a patch that makes that configurable (the name of the variable
should probably be better, and I don't know if this should be automatic
instead, perhaps when unregister is possible?):

diff --git a/lisp/spam.el b/lisp/spam.el
index e2d34b6..e136652 100644
--- a/lisp/spam.el
+++ b/lisp/spam.el
@@ -158,6 +158,12 @@ Normally this is nil, so only unseen messages will be 
checked."
   :type 'boolean
   :group 'spam)
 
+(defcustom spam-unregister-on-reregister nil
+  "Whether to always unregister before reregistering (i.e. to
+unlearn when changing ham to spam or vice versa)."
+  :type 'boolean
+  :group 'spam)
+
 (defcustom spam-whitelist (expand-file-name "whitelist" spam-directory)
   "The location of the whitelist.
 The file format is one regular expression per line.
@@ -1769,11 +1775,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
                                              t)
 
          ;; eliminate duplicates
-         (dolist (article (copy-sequence ulist))
-           (when (memq article rlist)
-             (incf delcount)
-             (setq rlist (delq article rlist))
-             (setq ulist (delq article ulist))))
+          (when (not spam-unregister-on-reregister)
+            (dolist (article (copy-sequence ulist))
+              (when (memq article rlist)
+                (incf delcount)
+                (setq rlist (delq article rlist))
+                (setq ulist (delq article ulist)))))
 
          (unless (zerop delcount)
            (gnus-message
-- 
1.6.3.3

-- 
 "But after all, who is? At least in our case - no one        Adam Sjøgren
  is such a great musician. But we are stubborn."        asjo@koldfront.dk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]