Subject: | Another crash due to Dovecot in-progress indicators |
Date: | Thu, 31 Mar 2016 14:29:10 -0500 |
To: | bug-Net-IMAP-Client [...] rt.cpan.org |
From: | David Harris <dharris [...] drh.net> |
I had a problem where Net::IMAP::Client was crashing due to Dovecot in-progress indicators.
I upgraded to 0.9505, but the problem remained, so I believe this is distinct from:
https://rt.cpan.org/Public/Bug/Display.html?id=84623 <https://rt.cpan.org/Public/Bug/Display.html?id=84623>
The problem was triggered by this line:
* OK Searched 78% of the mailbox, ETA 0:05
Which came between FETCH result lines, like this:
...
* 416049 FETCH (UID 761737 FLAGS (\Draft) BODY[HEADER.FIELDS (X-VI-BOXID)] {25}
* 416050 FETCH (UID 761739 FLAGS (\Draft) BODY[HEADER.FIELDS (X-VI-BOXID)] {24}
* OK Searched 78% of the mailbox, ETA 0:05
* 416051 FETCH (UID 761740 FLAGS (\Draft) BODY[HEADER.FIELDS (X-VI-BOXID)] {24}
* 416052 FETCH (UID 761741 FLAGS (\Draft) BODY[HEADER.FIELDS (X-VI-BOXID)] {25}
...
Here’s the patch:
--- Net-IMAP-Client-0.93.orig/lib/Net/IMAP/Client.pm 2016-03-31 12:44:47.000000000 -0500
+++ Net-IMAP-Client-0.93/lib/Net/IMAP/Client.pm 2016-03-31 12:45:40.000000000 -0500
@@ -413,6 +413,7 @@
if ($ok) {
my @ret;
foreach (@$lp) {
+ next if $_->[0] =~ m/^\*\s*OK\s/i;
my $tokens = _parse_tokens($_)->[3];
push @ret, { @$tokens };
}
I haven’t checked if this complies with the RFC.
(This shows 0.93, but I fixed the problem in 0.9505 then back-ported it to 0.93.)
Thanks,
-------------------------------------
David Harris
CEO & Lead Developer
DRH Internet Inc. | www.drh.net <http://www.drh.net/>
☎ 219-472-2420 x 702