;;; spam.el --- Identifying spam
-;; Copyright (C) 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: network
;;; Code:
+(eval-when-compile (require 'cl))
+
(require 'gnus-sum)
(require 'gnus-uu) ; because of key prefix issues
(require 'gnus) ; for the definitions of group content classification and spam processors
(require 'message) ;for the message-fetch-field functions
+;; for nnimap-split-download-body-default
+(eval-when-compile (require 'nnimap))
+
;; autoload executable-find
(eval-and-compile
;; executable-find is not autoloaded in Emacs 20
(eval-and-compile
(autoload 'query-dig "dig"))
+;; autoload spam-report
+(eval-and-compile
+ (autoload 'spam-report-gmane "spam-report"))
+
+;; autoload gnus-registry
+(eval-and-compile
+ (autoload 'gnus-registry-store-extra-entry "gnus-registry")
+ (autoload 'gnus-registry-fetch-extra "gnus-registry"))
+
;; autoload query-dns
(eval-and-compile
(autoload 'query-dns "dns"))
(defcustom spam-move-spam-nonspam-groups-only t
"Whether spam should be moved in non-spam groups only.
-When nil, only ham and unclassified groups will have their spam moved
-to the spam-process-destination. When t, spam will also be moved from
+When t, only ham and unclassified groups will have their spam moved
+to the spam-process-destination. When nil, spam will also be moved from
spam groups."
:type 'boolean
- :group 'spam-ifile)
+ :group 'spam)
+
+(defcustom spam-process-ham-in-nonham-groups nil
+ "Whether ham should be processed in non-ham groups."
+ :type 'boolean
+ :group 'spam)
+
+(defcustom spam-log-to-registry nil
+ "Whether spam/ham processing should be logged in the registry."
+ :type 'boolean
+ :group 'spam)
+
+(defcustom spam-process-ham-in-spam-groups nil
+ "Whether ham should be processed in spam groups."
+ :type 'boolean
+ :group 'spam)
+
+(defcustom spam-mark-only-unseen-as-spam t
+ "Whether only unseen articles should be marked as spam in spam
+groups. When nil, all unread articles in a spam group are marked as
+spam. Set this if you want to leave an article unread in a spam group
+without losing it to the automatic spam-marking process."
+ :type 'boolean
+ :group 'spam)
+
+(defcustom spam-mark-ham-unread-before-move-from-spam-group nil
+ "Whether ham should be marked unread before it's moved out of a spam
+group according to ham-process-destination. This variable is an
+official entry in the international Longest Variable Name
+Competition."
+ :type 'boolean
+ :group 'spam)
(defcustom spam-whitelist (expand-file-name "whitelist" spam-directory)
"The location of the whitelist.
:type 'boolean
:group 'spam)
+(defcustom spam-use-whitelist-exclusive nil
+ "Whether whitelist-exclusive should be used by spam-split.
+Exclusive whitelisting means that all messages from senders not in the whitelist
+are considered spam."
+ :type 'boolean
+ :group 'spam)
+
(defcustom spam-use-blackholes nil
"Whether blackholes should be used by spam-split."
:type 'boolean
:group 'spam)
+(defcustom spam-use-hashcash nil
+ "Whether hashcash payments should be detected by spam-split."
+ :type 'boolean
+ :group 'spam)
+
(defcustom spam-use-regex-headers nil
"Whether a header regular expression match should be used by spam-split.
-Also see the variable `spam-spam-regex-headers' and `spam-ham-regex-headers'."
+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)
:type 'boolean
:group 'spam)
+(defcustom spam-use-BBDB-exclusive nil
+ "Whether BBDB-exclusive should be used by spam-split.
+Exclusive BBDB means that all messages from senders not in the BBDB are
+considered spam."
+ :type 'b