[hashcash] hashcash-sendmail bug fixes.

  • From: Kyle Hasselbacher <kyle@xxxxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Fri, 2 Apr 2004 17:05:43 -0600

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

I noticed a bug that would make the daemon hang sometimes, and I think I
fixed it.  I was able to reproduce it reliably before, but now I can't.  It
would hang when it was trying to close its pipe to sendmail, and I'm
guessing that it's because sendmail had something to say but couldn't
because stderr and stdout are closed.  When I would take out the
'daemonize()' call, it would not hang (but also not output anything).

I'm still not completely positive what was going wrong, but:

1. I now use open3() to start sendmail, so I can look at stderr.
2. I log what it says, so if this crops up again, maybe I'll have
   some diagnostics to look at.

I also had a bug where if I premade two or more tokens for the same
recipient, they'd clobber each other, and I'd end up with only one.  Ouch.

The only user-visible changes in today's exciting episode are:

1. I add a Received: header to the message on the way through.  I see other
   software doing it, so I want to be like the big kids.  I actually looked
   at RFC2821 when doing this.
2. Since I need a hostname to add the tracing line, I went ahead and logged
   it when the daemon starts.
3. I'm also logging the RCS Id line when I start.

I don't think I added any odd dependencies here.  I use the `hostname`
shell command to get the hostname, and I'm pretty sure IPC::Open3 is a
standard part of Perl.  I avoided using a time/date library to figure out
the time zone I'm in, so I'd be interested if anyone notices that I got it
wrong.

There is still a bug I noticed where it was working on queue items out of
order.  That is, it wasn't prioritizing right.  I also think there's
probably some subtleties of premade token expiration that need to be nailed
down, but I won't go into my whole ugly to-do list here.
- -- 
Kyle Hasselbacher            Today is the last day of your life so far.
kyle@xxxxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAbfHG10sofiqUxIQRAlSaAJ486Hd5bzvSlp19vJ5ftuCB18vBcgCfWo9T
poaUPGM1r9hGGFvtulO8ZHI=
=NPSh
-----END PGP SIGNATURE-----

Other related posts:

  • » [hashcash] hashcash-sendmail bug fixes.