Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: mike [...] udel.edu
Cc:
AdminCc:

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



Date: Thu, 19 May 2005 15:33:37 -0400 (EDT)
From: Mike Porter <mike [...] UDel.Edu>
To: bug-Mail-IMAPClient [...] rt.cpan.org
Subject: Bug in IMAPClient.pm
When doing the tests with a real imap server: 0) Version Mail-IMAPClient-2.2.9. 1) Our server uses a '.' as the folder sep. 2) Line 3167 of IMAPClient.pm return 1 if scalar(grep /^${folder}${sep}/, $self->folders); ${sep} is undefined. It is undefined because $self->separator($folder); does not find the folder in the list array. Normally, when this happens, the default '/' is returned via line 339: my $list = (grep(/^\*\s+LIST\s+/,($self->list(undef,$target)||("NO")) ))[0] || qq("/"); As I mentioned, our sep is '.', not '/'. Suggest: [mike@taxi Mail-IMAPClient-2.2.9]$ gdiff -u IMAPClient.pm.old IMAPClient.pm --- IMAPClient.pm.old 2005-05-19 15:28:25.956961000 -0400 +++ IMAPClient.pm 2005-05-19 15:29:32.840537000 -0400 @@ -3161,6 +3161,9 @@ return 0 if $f =~ /HasNoChildren/i ; unless ( $f =~ /\\/) { # no flags at all unless there's a backslash my $sep = $self->separator($folder); + + $sep = $self->separator( undef ) if (!defined( $sep )); + return 1 if scalar(grep /^${folder}${sep}/, $self->folders); return 0; } or something similar to pick up the "INBOX" sep. Also: somewhere in the rfc, it states that a: f list "" "" * LIST (\Noselect) "." "" provides the sep. Mike - Mike Porter PGP Fingerprint: F4 AE E1 9F 67 F7 DA EA 2F D2 37 F3 99 ED D1 C2
New maintainer. On Thu May 19 15:41:57 2005, mike@udel.edu wrote: Show quoted text
> When doing the tests with a real imap server: > > 0) Version Mail-IMAPClient-2.2.9. > > 1) Our server uses a '.' as the folder sep. > > 2) Line 3167 of IMAPClient.pm > > return 1 if scalar(grep /^${folder}${sep}/, $self->folders);
In your case (and other peoples) this is a terrible bug: the $sep dot is seen as 'any character'. Of course, the filename can contain weird characters as well. Show quoted text
> my $sep = $self->separator($folder); > + > + $sep = $self->separator( undef ) if (!defined( $sep > ));
implemented as my $sep = $self->separator($folder) || $self->separator(undef); Show quoted text
> or something similar to pick up the "INBOX" sep. Also: somewhere in > the rfc, it states that a: > > f list "" "" > * LIST (\Noselect) "." ""
Only if current patches do not work. Fixes in 2.99_02. -- MarkOv
CC: DJKERNEN [...] cpan.org
Subject: Re: [rt.cpan.org #12883] Bug in IMAPClient.pm
Date: Tue, 23 Oct 2007 16:09:59 -0400 (EDT)
To: Mark Overmeer via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mike Porter <mike [...] UDel.Edu>
On Tue, 23 Oct 2007, Mark Overmeer via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=12883 > > > New maintainer. > > On Thu May 19 15:41:57 2005, mike@udel.edu wrote:
>> When doing the tests with a real imap server: >> >> 0) Version Mail-IMAPClient-2.2.9. >> >> 1) Our server uses a '.' as the folder sep. >> >> 2) Line 3167 of IMAPClient.pm >> >> return 1 if scalar(grep /^${folder}${sep}/, $self->folders);
> > In your case (and other peoples) this is a terrible bug: the > $sep dot is seen as 'any character'. Of course, the filename > can contain weird characters as well.
Well, that's embarrassing. return 1 if scalar(grep /^\Q${folder}${sep}/, $self->folders); I don't know if that is correct. I'm having trouble finding documentation on \Q. Show quoted text
>
>> my $sep = $self->separator($folder); >> + >> + $sep = $self->separator( undef ) if (!defined( $sep >> ));
> > implemented as > my $sep = $self->separator($folder) || $self->separator(undef);
boolean operator returning something other than t/f? I know it works... Show quoted text
>
>> or something similar to pick up the "INBOX" sep. Also: somewhere in >> the rfc, it states that a: >> >> f list "" "" >> * LIST (\Noselect) "." ""
> > Only if current patches do not work. > > Fixes in 2.99_02. > > -- MarkOv >
- Mike Porter PGP Fingerprint: F4 AE E1 9F 67 F7 DA EA 2F D2 37 F3 99 ED D1 C2
Subject: Re: [rt.cpan.org #12883] Bug in IMAPClient.pm
Date: Wed, 24 Oct 2007 00:27:53 +0200
To: "mike [...] udel.edu via RT" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* mike@udel.edu via RT (bug-Mail-IMAPClient@rt.cpan.org) [071023 20:11]: Show quoted text
> >> return 1 if scalar(grep /^${folder}${sep}/, $self->folders);
> > > > In your case (and other peoples) this is a terrible bug: the > > $sep dot is seen as 'any character'. Of course, the filename > > can contain weird characters as well.
> > return 1 if scalar(grep /^\Q${folder}${sep}/, $self->folders); > > I don't know if that is correct. I'm having trouble finding > documentation on \Q.
Yes, it is correct. But I am going for my $sep = $self->separator($folder) || $self->separator(undef); my $lead = $folder . $sep; my $len = length $lead; return scalar grep {$lead eq substr($_, 0, $len)} $self->folders; Show quoted text
> > implemented as > > my $sep = $self->separator($folder) || $self->separator(undef);
> > boolean operator returning something other than t/f? I know it > works...
Yes, they return the first trueth value, so can be used as 'default' fallback. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
probably resolved, closing ticket.