Skip Menu |
 

This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id: 24395
Status: resolved
Priority: 0/
Queue: Net-IMAP-Simple

People
Owner: jettero [...] cpan.org
Requestors: dani [...] fib.upc.edu
Cc:
AdminCc:

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



Subject: select problem?
Date: Tue, 16 Jan 2007 12:18:37 +0100
To: bug-Net-IMAP-Simple [...] rt.cpan.org, Dani Sanchez <dani [...] fib.upc.edu>
From: Dani Sanchez <dani [...] fib.upc.edu>
Download (untitled) / with headers
text/plain 1.8k
Hello, I have detected that the select command returns a non-value (error?) when the folder is empty. This is my test script: #!/usr/bin/perl # use Net::IMAP::Simple; my ($imaphost, $imapuser, $imappasswd,$imaptimeout,$mbox )=("ZZZZ","YYYY","XXX",60,"nagios"); # Internal Vars my ($imap,$msgcount,@msglines); $imap = Net::IMAP::Simple->new($imaphost, timeout=>$imaptimeout); if (!defined($imap)) { print("IMAP connect timeout (>$imaptimeout s, host: $imaphost)"); exit -1; } if (!$imap->login($imapuser => $imappasswd)) { print("POP3 login failed (user:$imapuser)"); } my @folders= $imap->mailboxes(); foreach (@folders) { print("MBOX: $_ \n"); } $msgcount = $imap->select($mbox); if (! defined($msgcount) ) { print ("Error accesing a $mbox -> ##".$imap->errstr ."##\n"); } # Count messages, that we are looking four: while ($msgcount > 0) { @msglines = @{$imap->top($msgcount)}; foreach (@msglines) { print("INBOX: $_ \n"); } $msgcount--; } The output: MBOX: .mailboxlist MBOX: Sent MBOX: mbox MBOX: Trash MBOX: Drafts MBOX: nagios MBOX: INBOX Error accesing a nagios -> ##warning unknown return string: * OK [PERMANENTFLAGS (\* \Answered \Flagged \Deleted \Draft \Seen)] Permanent flags ## The forder exists "nagios" exists and it's empty. When I access to the empty "nagios" mbox, the select doesn't return any value, but if I put a message in the folder the script runs ok. I think that the normal operation would be that returns a "0" value. The IMAP server is uw-imap IMAP4rev1 2004.357 is and the server is a SuSE-Linux 9.3 i586 with a 2.6.17-6 kernel I'ts a bug? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ O O O Daniel Sanchez Dorado O O O Responsable de Redes LCFIB O O O Facultad Informatica Barcelona UPC Tel. 934016933 dani@fib.upc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Download (untitled) / with headers
text/plain 219b
I believe this is solved and proved by test in 1.1899_01 (available on github only). -- If riding in an airplane is flying, then riding in a boat is swimming. 107 jumps, 43.5 minutes of freefall, 83.4 freefall miles.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.