(spam-bogofilter-bogosity-positive-spam-header): new variable, in
authorTeodor Zlatanov <tzz@lifelogs.com>
Mon, 27 Jan 2003 20:15:43 +0000 (20:15 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Mon, 27 Jan 2003 20:15:43 +0000 (20:15 +0000)
case more X-Bogosity is used than just "Yes/No"
(spam-ham-move-routine): semi-fixed, only first article is
properly moved now

lisp/ChangeLog
lisp/spam.el

index 037a1db..8d6fd55 100644 (file)
@@ -3,6 +3,11 @@
        * spam.el (spam-check-blackholes) 
        (spam-blackhole-good-server-regex): new variable to skip some IPs
        when checking blackholes; use it
+       (spam-check-bogofilter-headers) 
+       (spam-bogofilter-bogosity-positive-spam-header): new variable, in
+       case more X-Bogosity is used than just "Yes/No"
+       (spam-ham-move-routine): semi-fixed, only first article is
+       properly moved now
 
 2003-01-27  Jesper Harder  <harder@ifa.au.dk>
 
index eeda133..4b45d7e 100644 (file)
@@ -248,6 +248,11 @@ your main source of newsgroup names."
   :type 'string
   :group 'spam-bogofilter)
 
+(defcustom spam-bogofilter-bogosity-positive-spam-header "^\\(Yes\\|Spam\\)"
+  "The regex on `spam-bogofilter-header' for positive spam identification."
+  :type 'regexp
+  :group 'spam-bogofilter)
+
 (defcustom spam-bogofilter-database-directory nil
   "Directory path of the Bogofilter databases."
   :type '(choice (directory :tag "Location of the Bogofilter database directory")
@@ -408,15 +413,15 @@ your main source of newsgroup names."
 (defun spam-ham-move-routine (&optional group)
   (let ((articles gnus-newsgroup-articles)
        article ham-mark-values mark)
+
     (dolist (mark spam-ham-marks)
       (push (symbol-value mark) ham-mark-values))
-
-    (while articles
-      (setq article (pop articles))
-      (when (and (memq mark ham-mark-values)
+    
+    (dolist (article articles)
+      (when (and (memq (gnus-summary-article-mark article) ham-mark-values)
                 (stringp group))
-         (let ((gnus-current-article article))
-           (gnus-summary-move-article nil group))))))
+       (let ((gnus-current-article article))
+         (gnus-summary-move-article nil group))))))
  
 (defun spam-generic-register-routine (spam-func ham-func)
   (let ((articles gnus-newsgroup-articles)
@@ -853,12 +858,12 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
 (defun spam-check-bogofilter-headers (&optional score)
   (let ((header (message-fetch-field spam-bogofilter-header)))
       (when (and header
-              (string-match "^Yes" header))
+                (string-match spam-bogofilter-bogosity-positive-spam-header
+                              header))
          (if score
              (when (string-match "spamicity=\\([0-9.]+\\)" header)
                (match-string 1 header))
            spam-split-group))))
-         
 
 ;; return something sensible if the score can't be determined
 (defun spam-bogofilter-score ()