Karsten Bräckelmann schrieb:
On Tue, 2008-12-02 at 11:32 +0100, Dirk Bonengel wrote:
I'm looking into it. Only thing - seems to work here.

The reason why hash one is broken is the "workaround" introduced into
version 1.5.
  $body_copy =~ s/[[:graph:]]+//go;

This can not work.

Hash one is supposed to do this: Condense all consecutive, identical
whitespace chars into a single occurrence, then drop the graph chars and
compute the md5sum for the remaining whitespace signature.

The "workaround" above removes words *first*, usually resulting in a
bunch of spaces per line. With the original algorithm, these are exactly
what's being hashed! With the "workaround", they falsely get condensed
into a single space per line once the original hash generation is being
run.

Not quite. I throw away the content of $body_copy a few lines later and start afresh. The workaround is needed to prevent Perl (at least the one I use) to stall when applying /(\s.+?){20}/ to a complete mail body.

Dirk


Reply via email to