[hashcash] hashcash doesn't pick the right resource during check?

  • From: Kyle Hasselbacher <kyle@xxxxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Sun, 7 Mar 2004 20:35:52 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So, I got an email with these headers:

X-Hashcash: 0:040308:hashcash@xxxxxxxxxxxxx:23b5befdab7293dd
X-Hashcash: 0:040308:adam@xxxxxxxxxxxxxxx:6a8ed5496f8187d1
X-Hashcash: 0:040308:kyle@xxxxxxxxxxx:9cbe59c1c81b0d67

...which I believe to be correct form.  Someone correct me if I'm wrong
since although I didn't send the mail, it was my software that formed the
headers.  8-)

Anyway, I piped the whole message to a 'hashcash -cXyr kyle@xxxxxxxxxxx',
and it didn't like it.  If I change the -r resource to
'hashcash@xxxxxxxxxxxxx' (the first X-Hashcash header), it likes it.

I'm using version 0.28.  I looked at the CHANGELOG for 0.29 and didn't see
a fix for this listed, but I'd be happy to upgrade if that'll take care of
this.  It probably wouldn't be too hard to prefilter the message for
hashcash also so that it only sees the one token that I expect to match.

I have procmail handling this normally, BTW.  This is the recipe I use,
before my anti-spam measures, so that hashcashed mail can skip all the
other filters:

# -c check
# -q no output
# -y valid tokens are good even if not fully checked
# -X look for the X-Hashcash header
# -e expiration time for tokens (default 28 days)
# -d use a database to avoid double spending
# -f where the double spending DB is.
# -p purge the double spending database if it hasn't been done in that long
# -b number of bits of work to require
# -r "resource" to verify (e.g., kyle@xxxxxxxxxxx)
:0
* ^X-Hashcash: 
0:[0-9]+:[a-zA-Z0-9_+.-]+@(.+\.)?(hasselbacher\.org|toehold\.com):[0-9a-f]+$
* ^X-Hashcash: 
0:[0-9]+:\/[a-zA-Z0-9_+.-]+@(.+\.)?(hasselbacher\.org|toehold\.com)
* $? $HOME/bin/hashcash -c -q -y -X -e 31d -d -f $HOME/.tmda/hashcash.db -p 10d 
-b19 -r '$MATCH'
$DEFAULT

Thanks for your time and software!
- -- 
Kyle Hasselbacher | Disclaimer:  Do not add chemicals or
kyle@xxxxxxxxxxx  |              detergents to the water.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAS9wI10sofiqUxIQRAsuvAJ9T3S83EUgQSir8ZILAOFEIvGRehgCeIbvR
HHxTKHP5W6CFzcwBojw7Qzk=
=IdRR
-----END PGP SIGNATURE-----

Other related posts:

  • » [hashcash] hashcash doesn't pick the right resource during check?