Bug#518236: libnet-imap-simple-perl: empty return value of select() function

Daniel Parthey daniel.parthey at informatik.tu-chemnitz.de
Wed Mar 4 23:00:10 UTC 2009


Package: libnet-imap-simple-perl
Version: 1.17-3
Severity: important
Tags: patch


The following example program (when supplied with correct IMAP servername
and username/password combination) returns an empty "$messages" variable
when run against an IMAP server. Variable $messages should contain the
number of messages on the server, but it doesn't:

$ cat imap.pl 
#!/usr/bin/perl
use Net::IMAP::Simple;
my $imap = Net::IMAP::Simple->new('imapserver.example.org') ||
   die "Unable to connect to IMAP: $Net::IMAP::Simple::errstr\n";
if(!$imap->login('correct-username','correct-password')){
    print STDERR "Login failed: " . $imap->errstr . "\n";
    exit(1);
}
my $messages = $imap->select('INBOX');
print $messages." messages\n";
$imap->quit;

This bug also affects lenny since it ships libnet-imap-simple-perl 1.17-3.

$ ./imap.pl # with broken Simple.pm (wrong)
 messages

$ ./imap.pl # with patched Simple.pm (correct)
0 messages

With the following patch the function returns the correct value "0 messages".

--- /usr/share/perl5/Net/IMAP/Simple.pm.orig    2008-03-09 03:12:01.000000000 +0100
+++ /usr/share/perl5/Net/IMAP/Simple.pm 2009-03-04 23:46:35.000000000 +0100
@@ -252,7 +252,7 @@
                        }
                }
        },
- ) || return;
+ );
 
  return $self->{last}
 }

Regards,
Daniel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable'), (30, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libnet-imap-simple-perl depends on:
ii  perl                          5.10.0-19  Larry Wall's Practical Extraction 

libnet-imap-simple-perl recommends no packages.

libnet-imap-simple-perl suggests no packages.

-- no debconf information





More information about the pkg-perl-maintainers mailing list