Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: Lfzhao [...] aol.com
Cc:
AdminCc:

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



From: Lfzhao [...] aol.com
Date: Wed, 27 Oct 2004 16:32:55 EDT
Subject: (no subject)
To: bug-Mail-IMAPClient [...] rt.cpan.org
Hi David, I am a developer that builds small tools used inside our company. We have downloaded your IMAPClient.pm 2.2.9 and use it to fetch emails from our IMAP server. We did not set debug flag by new() or by $imap->Debug() because we found that it will put whole emails into our log file. The way we doing debug is checking $imap->LastError after each operation. If it is true, write the error string inside $@ into the log file. There are two things I think may be bugs and want to report to you. 1. $imap->LastError remains true if previous operation sets it to true. For example, I call message_string to fetch a list of messages from a mailbox. If one message caused a problem, the $imap->LastError remains true even the next call of message_string fetched message successful ( $@ is empty at the same time, that is good). 2. Sometimes $@ contains the message itself instead of the error. Sometimes, when $imap->LastError is set to true by message_string, we found the whole email message was written into the log file instead of error message. Do you know why this is happening? Thank you very much, Lanfang Zhao _lfzhao@aol.com_ (mailto:lfzhao@aol.com)
From: Lfzhao [...] aol.com
Date: Wed, 27 Oct 2004 16:38:21 EDT
Subject: Re: [cpan #8141] AutoReply: (no subject)
To: bug-Mail-IMAPClient [...] rt.cpan.org
RT-Send-Cc:
In a message dated 10/27/2004 4:33:36 PM Eastern Daylight Time, bug-Mail-IMAPClient@rt.cpan.org writes: cpan #8141 Sorry, I forgot the subject line. It should be "LastError, $@, and debug"
Subject: RE: IMAPClient
New maintainer On Wed Oct 27 16:32:05 2004, Lfzhao@aol.com wrote: Show quoted text
> There are two things I think may be bugs and want to report to you. > 1. $imap->LastError remains true if previous operation sets it > to true. > For example, I call message_string to fetch a list of messages from a > mailbox. If one message caused a problem, the $imap->LastError > remains true even > the next call of message_string fetched message successful ( $@ is > empty at > the same time, that is good).
True. There are quite some things wrong with the code. Patches welcome. Although: LastError does not imply error-of-last-statement. It behaves like $! does. Show quoted text
> 2. Sometimes $@ contains the message itself instead of the > error. > Sometimes, when $imap->LastError is set to true by message_string, we > found the > whole email message was written into the log file instead of error > message. Do > you know why this is happening? > Thank you very much,
There were different developers of the code. Inside _read_line(), $@ gets filled with $msg... which is quite horrible. Probably, some people's code depends on it. You have to live with it. Sorry.