Synch upstream.
authorSimon Josefsson <jas@extundo.com>
Wed, 14 Aug 2002 17:43:45 +0000 (17:43 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 14 Aug 2002 17:43:45 +0000 (17:43 +0000)
contrib/hashcash.el

index 44adb0c..d971fb7 100644 (file)
@@ -33,9 +33,13 @@ ADDR is the email address of the intended recipient and AMOUNT is
 the value of hashcash payment to be made to that user.  STRING, if
 present, is the string to be hashed; if not present ADDR will be used.")
 
-(defcustom hashcash "hashcash"
+(defcustom hashcash "/usr/local/bin/hashcash"
   "*The path to the hashcash binary.")
 
+(defcustom hashcash-in-news nil
+  "*Specifies whether or not hashcash payments should be made to newsgroups."
+  :type 'boolean)
+
 (require 'mail-utils)
 
 (defun hashcash-strip-quoted-names (addr)
@@ -98,13 +102,13 @@ Prefix arg sets default payment temporarily."
        (narrow-to-region (point-min) (point))
        (let ((to (hashcash-strip-quoted-names (mail-fetch-field "To" nil t)))
              (cc (hashcash-strip-quoted-names (mail-fetch-field "Cc" nil t)))
-             (ng (hashcash-strip-quoted-names 
-                  (mail-fetch-field "Newsgroups" nil t))))
+             (ng (hashcash-strip-quoted-names (mail-fetch-field "Newsgroups"
+                                                                nil t))))
          (when to
            (setq addrlist (split-string to ",[ \t\n]*")))
          (when cc
            (setq addrlist (nconc addrlist (split-string cc ",[ \t\n]*"))))
-         (when ng
+         (when (and hashcash-in-news ng)
            (setq addrlist (nconc addrlist (split-string ng ",[ \t\n]*")))))
        (when addrlist
          (mapc #'hashcash-insert-payment addrlist)))))