UW-IMAP: "kw0001 BAD Missing or invalid argument to LOGIN"

Apr 2, 2009 at 7:58 PM
I am getting this error when trying to login to my ISPs UW-IMAP server. I'm connecting ok and the compatability info is being returned form the server.

"* CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE CHILDREN MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND SASL-IR LOGIN-REFERRALS"

So PLAIN LoginType is selected and the I send one of the following two versions of the login command (multiple domains are hosted in my virtual server so the domain needs to be appended to each user (but I tried both forms just to be sure).

"LOGIN test-account-staff@<host> %1test%\r\n"
and
"LOGIN test-account-staff %1test%\r\n"

both resulted in

"kw0001 BAD Missing or invalid argument to LOGIN"


Any help with an idea of what is happening here would be *greatly* appreciated. I would be more than happy to provide any additional information that might be helpful.

Thanks,
Curt
Apr 2, 2009 at 11:09 PM
Okay, after doing some more digging (trust me, posting here was not my first attempt to find an answer, but neither was it my last :-) ) I was able to find some mentions of problems with some IMAP servers handing passwords with embedded double quotes in funky ways. Now, my password did not have any quotes but it did have the % character. So I thought, hmmmm, what if I put double quotes around the password. I telnetted into the server, double quoted the password (not the user name mind you, just the password) and the login proceeded along just fine. I have yet to determine if I need to quote all of my passwords or if the % character is being treated special and if I need to escape it rather than quote things, etc.

Any insight into that  part of it from anyone?

Anyway, just wanted to post this update to prevent anyone from wasting any of their time on my behalf.

Thanks,
Curt
Coordinator
Apr 17, 2009 at 2:54 AM
Guess we need to test this to see if other mail servers exhibit similar behavior. Also I bet this is just gonna be a problem with plain text logins and that login and cram-md5 will not have similar problems. I can see this being an issue in the ssl enabled connections to servers like gmail maybe as i think that uses plain text over ssl. Anyway good catch I'll put on my list of stuff to check out.