Synch to Gnus 200306101716.
authoryamaoka <yamaoka>
Tue, 10 Jun 2003 23:25:47 +0000 (23:25 +0000)
committeryamaoka <yamaoka>
Tue, 10 Jun 2003 23:25:47 +0000 (23:25 +0000)
lisp/ChangeLog
lisp/spam.el

index 16514eb..d649eec 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-10  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-check-bogofilter-headers): fix for when the score
+       is requested but the message is not spam
+
 2003-06-09  Teodor Zlatanov  <tzz@lifelogs.com>
        From Eric Knauel <knauel@informatik.uni-tuebingen.de>
 
index 95d23a8..70726fe 100644 (file)
@@ -1040,13 +1040,15 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
 ;;;; Bogofilter
 (defun spam-check-bogofilter-headers (&optional score)
   (let ((header (message-fetch-field spam-bogofilter-header)))
-      (when (and 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))))
+    (when header                       ; return nil when no header
+      (if score                                ; scoring mode
+         (if (string-match "spamicity=\\([0-9.]+\\)" header)
+             (match-string 1 header)
+           "0")
+       ;; spam detection mode
+       (when (string-match spam-bogofilter-bogosity-positive-spam-header
+                           header)
+         spam-split-group)))))
 
 ;; return something sensible if the score can't be determined
 (defun spam-bogofilter-score ()