Synch to Gnus 200307260957.
authoryamaoka <yamaoka>
Sat, 26 Jul 2003 13:41:01 +0000 (13:41 +0000)
committeryamaoka <yamaoka>
Sat, 26 Jul 2003 13:41:01 +0000 (13:41 +0000)
lisp/ChangeLog
lisp/flow-fill.el
lisp/spam.el

index cab38a0..8d61fb4 100644 (file)
@@ -1,3 +1,24 @@
+2003-07-26  Kai Gro\e,A_\e(Bjohann  <kai.grossjohann@gmx.net>
+
+       * flow-fill.el (fill-flowed): Empty lines separate paragraphs
+       even if the preceding line ends with a soft break.  Tiny patch
+       from Mark Thomas <swoon@bellatlantic.net>.
+
+2003-07-25  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-use-regex-body, spam-regex-body-spam) 
+       (spam-regex-body-ham): new variables, default to nil/empty/empty
+       (spam-install-hooks): added spam-use-regex-body to list or
+       pre-install conditions
+       (spam-list-of-checks): added spam-use-regex-body and
+       spam-check-regex-body to list of checks
+       (spam-list-of-statistical-checks): added spam-use-regex-body to
+       list of statistical checks
+       (spam-check-regex-body): invokes spam-check-regex-headers with
+       appropriate variable masking
+       (spam-check-regex-headers): changes to print "body" or "header"
+       where appropriate
+
 2003-07-25  Jesper Harder  <harder@ifa.au.dk>
 
        * smime.el (smime-ask-passphrase): Use read-passwd rather than
index ea95fb3..c4dcf00 100644 (file)
@@ -127,7 +127,7 @@ RFC 2646 suggests 66 characters for readability."
                      (save-excursion
                        (unless (eobp)
                          (forward-char 1)
-                         (looking-at (format "^\\(%s\\)\\([^>]\\)"
+                         (looking-at (format "^\\(%s\\)\\([^>\n\r]\\)"
                                              (or quote " ?"))))))
            (save-excursion
              (replace-match (if (string= (match-string 2) " ")
index 1f73204..6d25e7e 100644 (file)
@@ -155,6 +155,12 @@ Also see the variables `spam-regex-headers-spam' and `spam-regex-headers-ham'."
   :type 'boolean
   :group 'spam)
 
+(defcustom spam-use-regex-body nil
+  "Whether a body regular expression match should be used by spam-split.
+Also see the variables `spam-regex-body-spam' and `spam-regex-body-ham'."
+  :type 'boolean
+  :group 'spam)
+
 (defcustom spam-use-bogofilter-headers nil
   "Whether bogofilter headers should be used by spam-split.
 Enable this if you pre-process messages with Bogofilter BEFORE Gnus sees them."
@@ -202,6 +208,7 @@ considered spam."
                               spam-use-blackholes 
                               spam-use-hashcash 
                               spam-use-regex-headers 
+                              spam-use-regex-body 
                               spam-use-bogofilter-headers 
                               spam-use-bogofilter 
                               spam-use-BBDB 
@@ -252,6 +259,16 @@ All unmarked article in such group receive the spam mark on group entry."
   :type '(repeat (regexp :tag "Regular expression to match ham header"))
   :group 'spam)
 
+(defcustom spam-regex-body-spam '()
+  "Regular expression for positive body spam matches"
+  :type '(repeat (regexp :tag "Regular expression to match spam body"))
+  :group 'spam)
+
+(defcustom spam-regex-body-ham '()
+  "Regular expression for positive body ham matches"
+  :type '(repeat (regexp :tag "Regular expression to match ham body"))
+  :group 'spam)
+
 (defgroup spam-ifile nil
   "Spam ifile configuration."
   :group 'spam)
@@ -648,6 +665,7 @@ spamoracle database."
 (defvar spam-list-of-checks
   '((spam-use-blacklist                .       spam-check-blacklist)
     (spam-use-regex-headers            .       spam-check-regex-headers)
+    (spam-use-regex-body               .       spam-check-regex-body)
     (spam-use-whitelist                .       spam-check-whitelist)
     (spam-use-BBDB                     .       spam-check-BBDB)
     (spam-use-ifile                    .       spam-check-ifile)
@@ -670,10 +688,11 @@ name is the value of `spam-split-group', meaning that the message is
 definitely a spam.")
 
 (defvar spam-list-of-statistical-checks
-  '(spam-use-ifile spam-use-stat spam-use-bogofilter spam-use-spamoracle)
+  '(spam-use-ifile spam-use-regex-body spam-use-stat spam-use-bogofilter spam-use-spamoracle)
 "The spam-list-of-statistical-checks list contains all the mail
 splitters that need to have the full message body available.")
 
+;;;TODO: modify to invoke self with each specific check if invoked without specific checks
 (defun spam-split (&rest specific-checks)
   "Split this message into the `spam' group if it is spam.
 This function can be used as an entry in `nnmail-split-fancy', for
@@ -709,21 +728,30 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
       (setq nnimap-split-download-body-default t))))
 
 \f
+;;;; Regex body
+
+(defun spam-check-regex-body ()
+  (let ((spam-regex-headers-ham spam-regex-body-ham)
+       (spam-regex-headers-spam spam-regex-body-spam))
+    (spam-check-regex-headers t)))
+
+\f
 ;;;; Regex headers
 
-(defun spam-check-regex-headers ()
-  (let (ret found)
+(defun spam-check-regex-headers (&optional body)
+  (let ((type (if body "body" "header"))
+        ret found)
     (dolist (h-regex spam-regex-headers-ham)
       (unless found
        (goto-char (point-min))
        (when (re-search-forward h-regex nil t)
-         (message "Ham regex header search positive.")
+         (message "Ham regex %s search positive." type)
          (setq found t))))
     (dolist (s-regex spam-regex-headers-spam)
       (unless found
        (goto-char (point-min))
        (when (re-search-forward s-regex nil t)
-         (message "Spam regex header search positive." (match-string 1))
+         (message "Spam regex %s search positive." type)
          (setq found t)
          (setq ret spam-split-group))))
     ret))