Subject: | seems to be a bug in Net::IMAP::Simple new method |
Date: | Tue, 23 Oct 2007 17:06:11 -0400 (EDT) |
To: | bug-Net-IMAP-Simple [...] rt.cpan.org |
From: | canada_contact <canada_contact [...] yahoo.ca> |
Hi,
I am trying to create 5 parallel IMAP connections. My IMAP Server allows only 4 parallel connections per ipaddress. I verified it from command-line thru' telnet (i.e. telnet <ipaddress> 143 on 5 terminals).
But when I do it thru' perl script using the module Net::IMAP::Simple, it return me a valid object even on the 5th try and if I try to login using this object, login fails, without setting any error string in $imap->errstr.
So looks like the method "login" thinks that it is not a valid object, but I have no way of knowing it because new is returning a valid object.
I believe the new method should not return a valid object in this particular case (i.e. on 5th try as limit is 4 parallel connections per ipaddress).
Version Information:
ii libnet-imap-perl 0.02-5 A client interface to IMAP (Internet Message
ii libnet-imap-simple-perl 1.14-1 Perl extension for simple IMAP account handl
ii libnet-imap-simple-ssl-perl 1.3-2 Subclass of Net::IMAP::Simple with SSL suppo
OS:
uname -a
Linux develpdr 2.6.15-26-server #1 SMP Fri Sep 8 21:00:37 UTC 2006 i686 GNU/Linux
Perl version:
This is perl, v5.8.7 built for i486-linux-gnu-thread-multi
(with 1 registered patch, see perl -V for more detail)
Code to reproduce the bug (having IMAP server set to 4 parallel connection per ip address)
my @imap;
for (my $i=0; $i < 5; ++$i)
{
debug "creating IMAP connection $i\n";
$imap[$i] = Net::IMAP::Simple->new($imapServer,Debug => 1) or die "Can't connect: $!";
if(exists($imap[$i]))
{
fail "new IMAP connection should have failed!" if($i==4);
pass "new IMAP connection created!" if($i!=4);
}
else
{
fail "new IMAP connection failed!" if($i!=4);
pass "new IMAP connection failed as expected!" if($i==4);
}
}
for (my $i=0; $i < 5; ++$i)
{
my $imap = $imap[$i];
debug "logging in (IMAP) with imp$i\n";
defined($imap->login("imp$i", "123$i")) or fail "IMAP login failed!:$!";
}
Thanks,
---------------------------------
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail