emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/rmail-spam-filter.el


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/rmail-spam-filter.el
Date: Sat, 06 Aug 2005 14:54:16 -0400

Index: emacs/lisp/mail/rmail-spam-filter.el
diff -c emacs/lisp/mail/rmail-spam-filter.el:1.10 
emacs/lisp/mail/rmail-spam-filter.el:1.11
*** emacs/lisp/mail/rmail-spam-filter.el:1.10   Mon Jul  4 17:46:22 2005
--- emacs/lisp/mail/rmail-spam-filter.el        Sat Aug  6 18:54:05 2005
***************
*** 1,7 ****
  ;;; rmail-spam-filter.el  --- spam filter for rmail, the emacs mail reader.
  
! ;; Copyright (C) 2002 
! ;;            Free Software Foundation, Inc.
  ;; Keywords: email, spam, filter, rmail
  ;; Author: Eli Tziperman <eli AT deas.harvard.edu>
  
--- 1,6 ----
  ;;; rmail-spam-filter.el  --- spam filter for rmail, the emacs mail reader.
  
! ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  ;; Keywords: email, spam, filter, rmail
  ;; Author: Eli Tziperman <eli AT deas.harvard.edu>
  
***************
*** 183,189 ****
  is spam\\|another spam' (without the single quotes).  To specify that
  if the contents contain both this and that the message is spam,
  specify 'this\\&that' in the appropriate spam definition field."
!   :type '(repeat 
            (list :format "%v"
           (cons :format "%v" :value (from . "")
                 (const :format ""  from)
--- 182,188 ----
  is spam\\|another spam' (without the single quotes).  To specify that
  if the contents contain both this and that the message is spam,
  specify 'this\\&that' in the appropriate spam definition field."
!   :type '(repeat
            (list :format "%v"
           (cons :format "%v" :value (from . "")
                 (const :format ""  from)
***************
*** 202,208 ****
                 (string :tag "Contents"  ""))
           (cons :format "%v" :value (action . output-and-delete)
                 (const :format "" action)
!                (choice :tag "Action selection" 
                  (const :tag "output to spam folder and delete" 
output-and-delete)
                  (const :tag "delete spam" delete-spam)
                  ))
--- 201,207 ----
                 (string :tag "Contents"  ""))
           (cons :format "%v" :value (action . output-and-delete)
                 (const :format "" action)
!                (choice :tag "Action selection"
                  (const :tag "output to spam folder and delete" 
output-and-delete)
                  (const :tag "delete spam" delete-spam)
                  ))
***************
*** 218,224 ****
  (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. 
  The values are returned by destructively changing result.
  If FIELD-SYMBOL field does not exist AND is not specified,
  this may still be spam due to another element...
--- 217,223 ----
  (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.
  The values are returned by destructively changing result.
  If FIELD-SYMBOL field does not exist AND is not specified,
  this may still be spam due to another element...
***************
*** 259,265 ****
        (save-current-msg)
        (rsf-saved-bbdb/mail_auto_create_p nil)
        )
!     
      ;; make sure bbdb does not create entries for messages while spam
      ;; filter is scanning the rmail file:
      (setq rsf-saved-bbdb/mail_auto_create_p 'bbdb/mail_auto_create_p)
--- 258,264 ----
        (save-current-msg)
        (rsf-saved-bbdb/mail_auto_create_p nil)
        )
! 
      ;; make sure bbdb does not create entries for messages while spam
      ;; filter is scanning the rmail file:
      (setq rsf-saved-bbdb/mail_auto_create_p 'bbdb/mail_auto_create_p)
***************
*** 291,297 ****
  
        ;;; do we want to ignore case in spam definitions:
          (setq case-fold-search rsf-ignore-case)
!       
        ;; Check for blind CC condition.  Set vars such that while
        ;; loop will be bypassed and spam condition will trigger
        (if (and rsf-no-blind-cc
--- 290,296 ----
  
        ;;; do we want to ignore case in spam definitions:
          (setq case-fold-search rsf-ignore-case)
! 
        ;; Check for blind CC condition.  Set vars such that while
        ;; loop will be bypassed and spam condition will trigger
        (if (and rsf-no-blind-cc
***************
*** 339,345 ****
  
            ;; start scanning incoming message:
            ;;---------------------------------
!           
              ;; Maybe the different fields should also be done in a
              ;; loop to make the whole thing more flexible
            ;; if sender field is not specified in message being
--- 338,344 ----
  
            ;; start scanning incoming message:
            ;;---------------------------------
! 
              ;; Maybe the different fields should also be done in a
              ;; loop to make the whole thing more flexible
            ;; if sender field is not specified in message being
***************
*** 352,367 ****
            ;; next, if spam was not ruled out already, check subject:
              (check-field 'subject message-subject definition maybe-spam)
            ;; next, if spam was not ruled out already, check 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...
!             (check-field 'contents 
                           (buffer-substring
                            (rmail-msgbeg msg) (rmail-msgend msg))
                           definition maybe-spam)
!             
            ;; if the search in rsf-definitions-alist found
            ;; that this email is spam, output the email to the spam
            ;; rmail file, mark the email for deletion, leave the
--- 351,366 ----
            ;; next, if spam was not ruled out already, check subject:
              (check-field 'subject message-subject definition maybe-spam)
            ;; next, if spam was not ruled out already, check 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...
!             (check-field 'contents
                           (buffer-substring
                            (rmail-msgbeg msg) (rmail-msgend msg))
                           definition maybe-spam)
! 
            ;; if the search in rsf-definitions-alist found
            ;; that this email is spam, output the email to the spam
            ;; rmail file, mark the email for deletion, leave the
***************
*** 378,384 ****
              (setq num-element (+ num-element 1)))
            )
            )
!         
          ;; (BK) re-set originally used variables
          (setq this-is-a-spam-email (rest maybe-spam)
                maybe-spam (first maybe-spam))
--- 377,383 ----
              (setq num-element (+ num-element 1)))
            )
            )
! 
          ;; (BK) re-set originally used variables
          (setq this-is-a-spam-email (rest maybe-spam)
                maybe-spam (first maybe-spam))
***************
*** 610,618 ****
          (while definitions
            (setq current (car definitions))
            (setq definitions (cdr definitions))
!           (setq result 
                  (append result
!                         (list 
                           (list (assoc 'from current)
                                 (assoc 'to current)
                                 (assoc 'subject current)
--- 609,617 ----
          (while definitions
            (setq current (car definitions))
            (setq definitions (cdr definitions))
!           (setq result
                  (append result
!                         (list
                           (list (assoc 'from current)
                                 (assoc 'to current)
                                 (assoc 'subject current)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]