[hashcash] multiple addr, wildcard and regexp addr (Re: Re: Pure Python implementation of hashcash v.1)

On Fri, Sep 24, 2004 at 03:13:19PM -0500, Kyle Hasselbacher wrote:
> | I guess while I'm at it, I might also do 'check_hashcash_stamp.py' that
> | takes an rfc2822.
> 
> I think the regular hashcash tool does this already.  You just shove a
> message into it with -X and other options you want to check, and it gives 
> you a proper return code.  Examples, using procmail, are here:
> 
> http://www.hashcash.org/mail/mfa/procmail/

Hashcash can deal with receipt to wild-card addresses, multiple
addresses, and even multiple addresses defined by regexps.

The example for procmail however uses procmail regexp and a single
hashcash resource.

:0 * ^X-Hashcash: 
0:[0-9]+:\/[a-zA-Z0-9_+\.-]+@(.+\.)?(hasselbacher\.org|toehold\.com) 
* $? hashcash -cqXdp 1d -b20 -f $HOME/hashcash.db -r '$MATCH' $DEFAULT

You could equivalently do something like this:

hashcash -cX -r '*@hasselbacher.org' -r '*@*.hasselbacher.org' \
        -r '*@toehold.com' -r '*@*.toehold.com'

(using wildcard addresses).

Or using regexp addresses in one go:

hashcash -cX -E -r '[a-zA-Z0-9_+\.-]+@(.+\.)?(hasselbacher\.org|toehold\.com)'

(ie just use the regexp as is).

(untested but should work as long as the regexp library syntax matches
procmail's).

Adam

Other related posts: