]> git.eshelyaron.com Git - emacs.git/commitdiff
(vm-use-spam-filter)
authorEli Zaretskii <eliz@is.elta.co.il>
Mon, 16 Feb 2004 18:06:23 +0000 (18:06 +0000)
committerEli Zaretskii <eliz@is.elta.co.il>
Mon, 16 Feb 2004 18:06:23 +0000 (18:06 +0000)
(rsf-min-region-length-added-to-spam-list): New variables.
(rsf-bbdb-auto-delete-spam-bbdb-entries): Renamed from
rmail-bbdb-auto-delete-spam-entries.  Added cc: to recipients for
spam testing.  Don't delete spam message if automatic deletion
after output via variable rmail-delete-after-output is turned on.
(rsf-bbdb-dont-create-entries-for-deleted-messages): Renamed from
rsf-bbdb-dont-create-entries-for-spam.
(check-field): New function, extracted from code in
rmail-spam-filter to ease addition of header fields like
content-type.
(message-content-type): New variable to check the content-type:
field added, also in defcustom of rsf-definitions-alist.
(rmail-spam-filter): Replace repeated test code for header fields
by calls to check-field; change the call to
rmail-output-to-rmail-file such that rmail-current-message stays
the same to avoid wrong deletion of unseen flags.
(rsf-add-contents-type): New function to convert old format
of rmail-spam-definitions-alist into new one.
Changed prefixes of all variables and functions from
rmail-spam-filter- or spam-filter- or rmail-spam- to rsf-.

lisp/ChangeLog
lisp/mail/rmail-spam-filter.el

index be15fffb6e526a5bdcc6553af161d419e890e395..09d5dc617f2caee4f22baca9d8718dd5d5ea5a2e 100644 (file)
@@ -1,3 +1,28 @@
+2004-02-16  Eli Tziperman  <eli@deas.harvard.edu>
+
+       * rmail-spam-filter.el: (vm-use-spam-filter)
+       (rsf-min-region-length-added-to-spam-list): New variables.
+       (rsf-bbdb-auto-delete-spam-bbdb-entries): Renamed from
+       rmail-bbdb-auto-delete-spam-entries.  Added cc: to recipients for
+       spam testing.  Don't delete spam message if automatic deletion
+       after output via variable rmail-delete-after-output is turned on.
+       (rsf-bbdb-dont-create-entries-for-deleted-messages): Renamed from
+       rsf-bbdb-dont-create-entries-for-spam.
+       (check-field): New function, extracted from code in
+       rmail-spam-filter to ease addition of header fields like
+       content-type.
+       (message-content-type): New variable to check the content-type:
+       field added, also in defcustom of rsf-definitions-alist.
+       (rmail-spam-filter): Replace repeated test code for header fields
+       by calls to check-field; change the call to
+       rmail-output-to-rmail-file such that rmail-current-message stays
+       the same to avoid wrong deletion of unseen
+       flags. 
+       (rsf-add-contents-type): New function to convert old format
+       of rmail-spam-definitions-alist into new one.
+       Changed prefixes of all variables and functions from
+       rmail-spam-filter- or spam-filter- or rmail-spam- to rsf-.
+
 2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
 
        * loadhist.el (unload-hook-features-list): New defvar.
index b811e5991e7c266858100236675172ee0afe219b..f3bc0bcaa68e2a0e9678e7a840fd94006cd493f5 100644 (file)
@@ -1,7 +1,7 @@
 ;;; rmail-spam-filter.el  --- spam filter for rmail, the emacs mail reader.
 
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-
+;; Copyright (C) 2002 
+;;             Free Software Foundation, Inc.
 ;; Keywords: email, spam, filter, rmail
 ;; Author: Eli Tziperman <eli AT deas.harvard.edu>
 
@@ -28,7 +28,7 @@
 ;;; Automatically recognize and delete junk email before it is
 ;;; displayed in rmail/rmail-summary.  Spam emails are defined by
 ;;; specifying one or more of the sender, subject and contents.
-;;; URL: http://deas.harvard.edu/climate/eli/Downloads/rmail-spam-filter/
+;;; URL: http://www.weizmann.ac.il/~eli/Downloads/rmail-spam-filter/
 
 ;;; Usage:
 ;;; ------
@@ -83,7 +83,9 @@
 ;;; sender's bbdb entry as well _if_ it was created at the same day.
 
 (require 'rmail)
-(require 'rmailsum)
+(if (> emacs-major-version 20)
+    (require 'rmailsum)
+  (if (not (fboundp 'rmail-make-summary-line)) (load-library "rmailsum")))
 
 ;; For find-if and other cool common lisp functions we may want to use.
 (eval-when-compile
@@ -93,7 +95,6 @@
   "Spam filter for RMAIL, the mail reader for Emacs."
   :group 'rmail)
 
-;;;###autoload
 (defcustom rmail-use-spam-filter nil
   "*Non-nil to activate the rmail spam filter.
 Specify `rsf-definitions-alist' to define what you consider spam
@@ -214,7 +215,7 @@ for interaction with `rsf-bbdb-auto-delete-spam-entries'")
 
 ;; the advantage over the automatic filter definitions is the AND conjunction
 ;; of in-one-definition-elements
-(defun rsf-check-field (field-symbol message-data definition result)
+(defun check-field (field-symbol message-data definition result)
   "Check if field-symbol is in `rsf-definitions-alist'.
 Capture maybe-spam and this-is-a-spam-email in a cons in result,
 where maybe-spam is in first and this-is-a-spam-email is in rest. 
@@ -313,7 +314,7 @@ it from rmail file.  Called for each new message retrieved by
                   this-is-a-spam-email nil))
 
         ;; maybe-spam is in first, this-is-a-spam-email in rest, this
-        ;; simplifies the call to rsf-check-field
+        ;; simplifies the call to check-field
         (setq maybe-spam (cons maybe-spam this-is-a-spam-email))
 
        ;; scan all elements of the list rsf-definitions-alist
@@ -344,18 +345,18 @@ it from rmail file.  Called for each new message retrieved by
            ;; scanned, AND if "from" field does not appear in spam
            ;; definitions for this element, this may still be spam
            ;; due to another element...
-            (rsf-check-field 'from message-sender definition maybe-spam)
+            (check-field 'from message-sender definition maybe-spam)
            ;; next, if spam was not ruled out already, check recipients:
-            (rsf-check-field 'to message-recipients definition maybe-spam)
+            (check-field 'to message-recipients definition maybe-spam)
            ;; next, if spam was not ruled out already, check subject:
-            (rsf-check-field 'subject message-subject definition maybe-spam)
+            (check-field 'subject message-subject definition maybe-spam)
            ;; next, if spam was not ruled out already, check content-type:
-            (rsf-check-field 'content-type message-content-type 
+            (check-field 'content-type message-content-type 
                          definition maybe-spam)
            ;; next, if spam was not ruled out already, check
            ;; contents: if contents field is not specified, this may
            ;; still be spam due to another element...
-            (rsf-check-field 'contents 
+            (check-field 'contents 
                          (buffer-substring
                           (rmail-msgbeg msg) (rmail-msgend msg))
                          definition maybe-spam)
@@ -631,5 +632,4 @@ automatically, no user input is required."
 
 (provide 'rmail-spam-filter)
 
-;;; arch-tag: 03e1d45d-b72f-4dd7-8f04-e7fd78249746
 ;;; rmail-spam-fitler ends here