Subject: | Mail-IMAPClient bug in get_envelope |
Date: | Mon, 29 Nov 2010 19:37:31 +0200 |
To: | bug-Mail-IMAPClient [...] rt.cpan.org |
From: | tinimi <tinimi [...] gmail.com> |
Hi.
Mail-IMAPClient version: 3.25
Perl version 5.8.7
get_envelope fails on empty "Reply-To" header.
this is example of envelope of message, that brokes it:
Read: * 2 FETCH (UID 42895 ENVELOPE ("Mon, 29 Nov 2010 18:28:23 +0200"
"test" (("Nikolay Kravchenko" NIL "nkravchenko" "***")) (("Nikolay
Kravchenko" NIL "nkravchenko" "***")) () ((NIL NIL "***" "***")) NIL NIL
NIL "***"))
(i'm mask a few fields with stars). As your could see - there are just ()
instead of "reply-to".
In email header "Reply-To:" exists, but empty.
To fix it, I'm write stupid fix:
IMAPClient/BodyStructure/Parse.pm:
12194 unless (defined ($_tok =
Parse::RecDescent::Mail::IMAPClient::BodyStructure::Parse::replyto($thisparser,$text,$repeating,$_noactions,sub
{ \@arg })))
12195 {
12196
12197 # Parse::RecDescent::_trace(q{<<Didn't match
subrule: [replyto]>>},
12198 #
Parse::RecDescent::_tracefirst($text),
12199 # q{envelopestruct},
12200 # $tracelevel)
12201 # if defined
$::RD_TRACE;
12202 # $expectation->failed();
12203 # last;
12204 $_tok = '';
12205 $text = substr($text, 1);
12206 }
I'm comment lines 12197-12203 and add lines 12204 and 12205.
This is just workaround, because I don't know perl.
Also, seems this bug exists on another empty headers.
Kind regards,
Nick