Skip Menu |
 

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

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

People
Owner: CFABER [...] cpan.org
Requestors: kjohansen [...] verio.net
Cc:
AdminCc:

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

Attachments
C:\WINDOWS\Desktop\login-patch.txt



Subject: login() doesn't report success when IMAP server returns more than one line response
Download (untitled) / with headers
text/plain 316b
Some implementations of IMAP return the capabilities on a separate line from the OK status. The login() method of Net::IMAP::Simple will only take one line. If it doesn't say "OK" then login will return an empty value, which indicates failure. Here's a patch for login() that will handle multiple lines of response.
*** Net/IMAP/Simple.pm.orig Sun Sep 15 20:34:59 2002 --- Net/IMAP/Simple.pm Sun Sep 15 20:39:25 2002 *************** *** 116,125 **** $id = $self->_nextid(); print $sh "$id LOGIN $user $pass\r\n"; - $resp = $sh->getline(); ! if ( $resp =~ /^$id\s+OK/i ) { ! return $self->select( 'INBOX' ); } return; --- 116,127 ---- $id = $self->_nextid(); print $sh "$id LOGIN $user $pass\r\n"; ! while ( $resp = $sh->getline() ) { ! if ( $resp =~ /^$id\s+OK/i ) { ! return $self->select( 'INBOX' ); ! } ! last if ($resp =~ /^$id\s+(NO|BAD)/i); } return;


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.