(spam-check-bogofilter-headers): fix for when the score is requested
authorTeodor Zlatanov <tzz@lifelogs.com>
Tue, 10 Jun 2003 17:16:52 +0000 (17:16 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Tue, 10 Jun 2003 17:16:52 +0000 (17:16 +0000)
but the message is not spam

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 a915bba..bcd2119 100644 (file)
@@ -1043,13 +1043,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 ()