+2003-02-05 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-check-BBDB): no need to regexp-quote the argument
+ of bbdb-search-simple, use spam-use-BBDB-exclusive
+ (spam-check-whitelist): use spam-use-whitelist-exclusive
+ (spam-use-whitelist-exclusive): new variable affecting
+ spam-use-whitelist
+ (spam-use-BBDB-exclusive): new variable affecting spam-use-BBDB
+
2003-02-05 Simon Josefsson <jas@extundo.com>
* gnus-agent.el (gnus-agent-expire-days): Change default to nil.
: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
: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 'boolean
+ :group 'spam)
+
(defcustom spam-use-ifile nil
"Whether ifile should be used by spam-split."
:type 'boolean
(spam-enter-ham-BBDB (spam-fetch-field-from-fast article)))))
(defun spam-check-BBDB ()
- "Mail from people in the BBDB is never considered spam"
+ "Mail from people in the BBDB is classified as ham or non-spam"
(let ((who (message-fetch-field "from")))
(when who
- (setq who (regexp-quote (cadr
- (gnus-extract-address-components who))))
+ (setq who (cadr (gnus-extract-address-components who)))
(if (bbdb-search-simple nil who)
- nil spam-split-group)))))
+ t
+ (if spam-use-BBDB-exclusive
+ spam-split-group
+ nil))))))
(file-error (progn
(defalias 'bbdb-search-simple 'ignore)
(insert address "\n")
(save-buffer)))
-;;; returns nil if the sender is in the whitelist, spam-split-group otherwise
+;;; returns t if the sender is in the whitelist, nil or spam-split-group otherwise
(defun spam-check-whitelist ()
;; FIXME! Should it detect when file timestamps change?
(unless spam-whitelist-cache
(setq spam-whitelist-cache (spam-parse-list spam-whitelist)))
- (if (spam-from-listed-p spam-whitelist-cache) nil spam-split-group))
+ (if (spam-from-listed-p spam-whitelist-cache)
+ t
+ (if spam-use-whitelist-exclusive
+ spam-split-group
+ nil)))
(defun spam-check-blacklist ()
;; FIXME! Should it detect when file timestamps change?