[hashcash] Re: Mutt and hashcash

  • From: Adam Back <adam@xxxxxxxxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Sun, 7 Mar 2004 20:16:37 -0500

Well after some tweaking I got it to work.  It maybe that I was
misconfiguring mutt but I put this in my .muttrc:

set sendmail='/home/adam/bin/hashcash-sendmail'

but found that mutt invokes it as:

"hashcash-sendmail -- adam@xxxxxxxxxxxxxxx"

and the parsing code with grep( /^--$/ .. 0, @args ) wasn't working
out.  I didn't understand what that grep is supposed to do, so I
changed to:

my $process_args = 1;
my @a = @args;
while ( my $arg = shift( @a ) ) {
    if ( $arg eq '--' ) { $process_args = 0; }
    if ( $process_args ) {
        if ( $arg eq '-f' ) {
            shift( @a );
            next;
        }
        push( @env_recip, $arg ) if ( $arg !~ /^-/ );
    } else {
        push( @env_recip, $arg );
    }
}

I also added:

if ( !-d $workdir ) { mkdir($workdir); }
if ( !-d "$workdir/queue" ) { mkdir("$workdir/queue"); }
if ( !-d "$workdir/tmp" ) { mkdir("$workdir/tmp"); }

near the top of both programs as they didn't exist system and it fails
if they don't.

Well haven't tested with two recipients, so this will be a test.

Very nice!

Adam

Kyle Hasselbacher wrote:
> [...]
> There's just the code there, but it has some comments that I've tossed in

Other related posts: