* spam.el (spam-bogofilter-articles): Use message-remove-header
authorTeodor Zlatanov <tzz@lifelogs.com>
Tue, 31 Dec 2002 12:30:20 +0000 (12:30 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Tue, 31 Dec 2002 12:30:20 +0000 (12:30 +0000)
to remove headers; the old way incorrectly removed just the first
line of folded headers.

lisp/ChangeLog
lisp/spam.el

index 4d1e044..9e4af25 100644 (file)
@@ -1,11 +1,16 @@
 2002-12-31  Teodor Zlatanov  <tzz@lifelogs.com>
-       patch from Michael Shields  <shields@msrl.com>
+
+       patches from Michael Shields  <shields@msrl.com>
 
        * spam.el (spam-bogofilter-articles): Select the article
        body using gnus-summary-show-article t instead of
        gnus-summary-select-article; this presents the raw text
        without running any hooks.
 
+       * spam.el (spam-bogofilter-articles): Use message-remove-header
+       to remove headers; the old way incorrectly removed just the first
+       line of folded headers.
+
 2002-12-31  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-start.el (gnus-load): Replace `ding-file' with `file'.
index 433aba0..216cb16 100644 (file)
@@ -543,15 +543,10 @@ spamicity coefficient of each, and the overall article spamicity."
              (insert-buffer-substring gnus-original-article-buffer)
              ;; Remove spam classification redundant headers: they may induce
              ;; unwanted biases in later analysis.
-             (goto-char (point-min))
-             (while (not (or (eobp) (= (following-char) ?\n)))
-               (if (looking-at remove-regexp)
-                   (delete-region (point)
-                                  (save-excursion (forward-line 1) (point)))
-                 (forward-line 1)))
-             (goto-char (point-min))
+             (message-remove-header remove-regexp t)
              ;; Bogofilter really wants From envelopes for counting articles.
              ;; Fake one at the beginning, make sure there will be no other.
+             (goto-char (point-min))
              (if (looking-at "From ")
                  (forward-line 1)
                (insert "From nobody " (current-time-string) "\n"))