(spam-use-hashcash): new variable
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 7 Mar 2003 17:00:21 +0000 (17:00 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 7 Mar 2003 17:00:21 +0000 (17:00 +0000)
(spam-list-of-checks): added spam-use-hashcash with associated spam-check-hashcash
(spam-check-hashcash): new function, installed iff hashcash.el is loaded

lisp/ChangeLog
lisp/spam.el

index 7e261c6..07b62c1 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-07  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-use-hashcash): new variable
+       (spam-list-of-checks): added spam-use-hashcash with associated spam-check-hashcash
+       (spam-check-hashcash): new function, installed iff hashcash.el is loaded
+
 2003-03-06  Kevin Greiner  <kgreiner@xpediantsolutions.com>
 
        * gnus-agent.el (gnus-agent-fetch-group-1): Added default
index 35f2213..451f64f 100644 (file)
@@ -112,6 +112,11 @@ are considered spam."
   :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'."
@@ -558,6 +563,7 @@ your main source of newsgroup names."
     (spam-use-ifile                    .       spam-check-ifile)
     (spam-use-stat                     .       spam-check-stat)
     (spam-use-blackholes               .       spam-check-blackholes)
+    (spam-use-hashcash                 .       spam-check-hashcash)
     (spam-use-bogofilter-headers       .       spam-check-bogofilter-headers)
     (spam-use-bogofilter               .       spam-check-bogofilter))
 "The spam-list-of-checks list contains pairs associating a parameter
@@ -670,6 +676,20 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
     (when matches
       spam-split-group)))
 \f
+;;;; Hashcash.
+
+(condition-case nil
+    (progn
+      (require 'hashcash)
+      
+      (defun spam-check-hashcash ()
+       "Check the headers for hashcash payments."
+       (mail-check-payment)))          ;mail-check-payment returns a boolean
+
+  (file-error (progn
+               (defalias 'mail-check-payment 'ignore)
+               (defalias 'spam-check-hashcash 'ignore))))
+\f
 ;;;; BBDB 
 
 ;;; original idea for spam-check-BBDB from Alexander Kotelnikov