Date: | Fri, 09 May 2003 10:52:10 -0500 |
To: | bug-Mail-IMAPClient [...] rt.cpan.org |
From: | Phil Tracy <ptracy [...] northwestern.edu> |
Subject: | login bug -- quoting the password |
Hi, first off thanks for a great module. This will be very handy for
me. I've encountered a problem I can't find any reference to, so maybe
it's a bug. Or at least a feature I don't understand how to
use. Suggestions or pointers to good references are appreciated.
During testing of a utility using imapclient, a user here ran into trouble
logging in with a password that has a '*' character in it. I was able to
reproduce the problem easily by creating a test account with a * in the
password. This is legal for our Solaris 8 system as far as I know, and my
test user can login fine through other methods, including telnet'ing to
port 143 and logging in while quoting the password. We're running Perl
5.6.1, UW imapd.
Here's a sample script demonstrating the problem:
###################################################
#!/usr/local/bin/perl
use Mail::IMAPClient;
my $server = 'localhost';
my $user = 'adummy';
my $pass = 'bogus*pw';
my $imap = Mail::IMAPClient->new(
Server => $server,
User => $user,
Password => $pass,
Debug => 1);
exit;
###################################################
And here's the output:
###################################################
Using Mail::IMAPClient version 2.2.7 and perl version 5.6.1 (5.006001)
Read: * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] localhost
IMAP4rev1 2002.334 at Fri, 9 May 2003 10:35:51 -0500 (CDT)
Connect: Received this from readline: 0/OUTPUT/* OK [CAPABILITY IMAP4REV1
LOGIN-REFERRALS AUTH=LOGIN] localhost IMAP4rev1 2002.334 at Fri, 9 May 2003
10:35:51 -0500 (CDT)
Sending: 1 Login "XXXXXXXX" XXXXXXXX
Sent 27 bytes
Read: 1 BAD Missing or invalid argument to LOGIN
###################################################
Another experiment demonstrates that this works fine when quoting the password:
###################################################
~> telnet localhost 143
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] localhost IMAP4rev1
2002.334 at Fri, 9 May 2003 10:38:24 -0500 (CDT)
a1 login "adummy" "bogus*pw"
a1 OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS BINARY SCAN
SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User adummy
authenticated
###################################################
I've tried putting literal " characters around the password, but that
doesn't seem to work. I've also tried instantiating 2nd imapclient class,
and using the ->Quote method to quote the password, but that doesn't work
either. Any suggestions? Thanks for your time.
--
Phil Tracy
Northwestern University, Evanston, IL. USA
ptracy@northwestern.edu http://dopey.tss.northwestern.edu/tracy/