+2003-10-03 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-check-blackholes): exit the loop if matches are
+ found (idea from Adrian Lanz <lanz@fowi.ethz.ch>)
+ (spam-check-bogofilter-headers, spam-check-blackholes, spam-check-BBDB)
+ (spam-from-listed-p): use nnmail-fetch-field instead of message-fetch-field
+
+
2003-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-decode.el (mm-attachment-file-modes): Change the default
(defun spam-check-blackholes ()
"Check the Received headers for blackholed relays."
- (let ((headers (message-fetch-field "received"))
+ (let ((headers (nnmail-fetch-field "received"))
ips matches)
(when headers
(with-temp-buffer
(dolist (ip ips)
(unless (and spam-blackhole-good-server-regex
(string-match spam-blackhole-good-server-regex ip))
- (let ((query-string (concat ip "." server)))
- (if spam-use-dig
- (let ((query-result (query-dig query-string)))
- (when query-result
- (gnus-message 5 "(DIG): positive blackhole check '%s'"
- query-result)
- (push (list ip server query-result)
- matches)))
- ;; else, if not using dig.el
- (when (query-dns query-string)
- (gnus-message 5 "positive blackhole check")
- (push (list ip server (query-dns query-string 'TXT))
- matches))))))))
+ (unless matches
+ (let ((query-string (concat ip "." server)))
+ (if spam-use-dig
+ (let ((query-result (query-dig query-string)))
+ (when query-result
+ (gnus-message 5 "(DIG): positive blackhole check '%s'"
+ query-result)
+ (push (list ip server query-result)
+ matches)))
+ ;; else, if not using dig.el
+ (when (query-dns query-string)
+ (gnus-message 5 "positive blackhole check")
+ (push (list ip server (query-dns query-string 'TXT))
+ matches)))))))))
(when matches
spam-split-group)))
\f
(defun spam-check-BBDB ()
"Mail from people in the BBDB is classified as ham or non-spam"
- (let ((who (message-fetch-field "from")))
+ (let ((who (nnmail-fetch-field "from")))
(when who
(setq who (cadr (gnus-extract-address-components who)))
(if (bbdb-search-simple nil who)
(nreverse contents))))
(defun spam-from-listed-p (cache)
- (let ((from (message-fetch-field "from"))
+ (let ((from (nnmail-fetch-field "from"))
found)
(while cache
(let ((address (pop cache)))
\f
;;;; Bogofilter
(defun spam-check-bogofilter-headers (&optional score)
- (let ((header (message-fetch-field spam-bogofilter-header)))
+ (let ((header (nnmail-fetch-field spam-bogofilter-header)))
(when header ; return nil when no header
(if score ; scoring mode
(if (string-match "spamicity=\\([0-9.]+\\)" header)