Subject: | Mail::Box:::Thread::Mangager vs. invalid(?) References/In-Reply-To fields |
Hi,
Mail::Box::Thread::Manager parses references/in-reply-to headers assuming the message IDs
are valid.
However, some messages from nntp.perl.org's news server have headers that contain strings
like "< >", where the space matches [^>]*, and is then scrubbed until the message ID is the
empty string.
Then it explodes when trying to create a dummy message with an empty message ID.
I suggest the regex be changed to something like /<\s*(.*?)\s*>/. Attached is a patch with a
slightly different regex coding style, more in line with yours.
Cheers,
-Yuval
Subject: | thread_manager.patch |
--- Manager.pm.orig 2006-07-28 22:18:38.000000000 +0300
+++ Manager.pm 2006-07-28 22:19:42.000000000 +0300
@@ -295,7 +295,7 @@
my $replies;
if(my $irt = $head->get('in-reply-to'))
- { for($irt =~ m/\<([^>]*)\>/)
+ { for($irt =~ m/\<\s*([^>]+)\s*\>/)
{ my $msgid = $1;
$msgid =~ s/\s+//g;
$replies = $self->{MBTM_ids}{$msgid} || $self->createDummy($msgid);
@@ -304,7 +304,7 @@
my @refs;
if(my $refs = $head->get('references'))
- { while($refs =~ s/\<([^>]*)\>//s)
+ { while($refs =~ s/\<\s*([^>]+)\s*\>//s)
{ my $msgid = $1;
$msgid =~ s/\s//gs;
push @refs, $self->{MBTM_ids}{$msgid} || $self->createDummy($msgid);