Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 44762
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: PLOBBES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: set LastError if a BYE response is received to any command but LOGOUT
Note this bug is related to the following bugs: 18547 "word too long" using fetch_hash 18376 fetch_hash() fails on large folders (command line too long) Below is a snippet from a log/trace of an IMAP session: Sending: 59 UID FETCH 3418,3602,3605,...(lots more)...,36772:36774,36782:36783 BODY.PEEK[HEADER] Sent 17313 bytes Read: * BYE [ALERT] Fatal error: max atom size too small: No such file or directory This example is apparently from courier-imap which defines this arbitrary limit to command/request length: /* ATOMS have the following maximum length */ #define IT_MAX_ATOM_SIZE 16384 Per RFC 3501 (http://www.faqs.org/rfcs/rfc3501.html) secton 7.1.5 "BYE Response" ...The BYE response is sent under one of four conditions: 1) as part of a normal logout sequence. The server will close the connection after sending the tagged OK response to the LOGOUT command. 2) as a panic shutdown announcement. The server closes the connection immediately. 3) as an announcement of an inactivity autologout. The server closes the connection immediately. 4) as one of three possible greetings at connection startup, indicating that the server is not willing to accept a connection from this client. The server closes the connection immediately. The difference between a BYE that occurs as part of a normal LOGOUT sequence (the first case) and a BYE that occurs because of a failure (the other three cases) is that the connection closes immediately in the failure case. Given that 2,3,4 are considered failure cases we should set LastError if we receive a BYE that does not come from a LOGOUT command. Here's a simple patch that should support this: $ diff -u IMAPClient.pm.LATEST IMAPClient.pm --- IMAPClient.pm.ORIG 2009-02-24 16:29:24.000000000 -0500 +++ IMAPClient.pm 2009-04-02 14:52:04.000000000 -0400 @@ -1136,6 +1136,7 @@ if($o->[DATA] =~ /^\*\s+BYE/im) { $self->State(Unconnected); + $self->LastError($o->[DATA]) unless ($string =~ /^LOGOUT/i); return undef; } }
Subject: Re: [rt.cpan.org #44762] set LastError if a BYE response is received to any command but LOGOUT
Date: Fri, 3 Apr 2009 12:12:04 +0200
To: Phil Lobbes via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Phil Lobbes via RT (bug-Mail-IMAPClient@rt.cpan.org) [090402 19:16]: Show quoted text
> Thu Apr 02 15:16:50 2009: Request 44762 was acted upon. > Transaction: Ticket created by PLOBBES > Queue: Mail-IMAPClient > Subject: set LastError if a BYE response is received to any > command but LOGOUT > > Note this bug is related to the following bugs: > 18547 "word too long" using fetch_hash > 18376 fetch_hash() fails on large folders (command line too long)
I believe that those to wish smart behavior from the code, breaking-up long requests automatically. That would DWIM. Your problem is comparible, but your solutions solves something else. Show quoted text
> + $self->LastError($o->[DATA]) unless ($string =~ /^LOGOUT/i);
This is a useful addition. But what about your actual problem? Do you have a patch for it as well? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #44762] set LastError if a BYE response is received to any command but LOGOUT
Date: Fri, 03 Apr 2009 12:18:43 -0400
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Phil Lobbes <phil [...] perkpartners.com>
This compliments a fix for the command length fix which I'll have forth-coming. I'll need just a little time to wrap that up. Any hope you'll be incorporating the other patches I have in the other bugs? I see you did a new release but didn't incorporate any of those... Please, pretty please :-). Phil Mark Overmeer via RT <bug-Mail-IMAPClient@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=44762 > > > * Phil Lobbes via RT (bug-Mail-IMAPClient@rt.cpan.org) [090402 19:16]:
> > Thu Apr 02 15:16:50 2009: Request 44762 was acted upon. > > Transaction: Ticket created by PLOBBES > > Queue: Mail-IMAPClient > > Subject: set LastError if a BYE response is received to any > > command but LOGOUT > > > > Note this bug is related to the following bugs: > > 18547 "word too long" using fetch_hash > > 18376 fetch_hash() fails on large folders (command line too long)
> > I believe that those to wish smart behavior from the code, breaking-up > long requests automatically. That would DWIM. Your problem is comparible, > but your solutions solves something else. >
> > + $self->LastError($o->[DATA]) unless ($string =~ /^LOGOUT/i);
> > This is a useful addition. > But what about your actual problem? Do you have a patch for it as well? > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net >
Subject: Re: [rt.cpan.org #44762] set LastError if a BYE response is received to any command but LOGOUT
Date: Fri, 3 Apr 2009 20:14:12 +0200
To: "phil [...] perkpartners.com via RT" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* phil@perkpartners.com via RT (bug-Mail-IMAPClient@rt.cpan.org) [090403 16:19]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=44762 > > > This compliments a fix for the command length fix which I'll have > forth-coming. I'll need just a little time to wrap that up. Any hope > you'll be incorporating the other patches I have in the other bugs? I > see you did a new release but didn't incorporate any of those...
Quite often when I look at RT, I see all kinds of bug-reports which I did miss the email warning for. But the last weeks, I did not have time to look into RT myself. Now I see a considerable list for Mail::ImapClient and I will have a look at them asap. Maybe tonight. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
will be finxed in 3.16