Search code examples
imap

What does "BAD unrecognized extra arguments to LOGIN command" mean?


I've been investigating issues with IMAP on mail.btinternet.com by using the Linux command line (with help from https://seeit.org/2010/01/31/debug-your-imap-server-with-telnet/)

Whatever username and password I try, I get this:

$ openssl s_client -connect mail.btinternet.com:993
[ssl stuff omitted]
* OK IMAP4 PROXY server ready
a001 login fred xyzzy
a001 BAD unrecognized extra arguments to LOGIN command

For comparison, using the Yahoo server, I get this:

$ openssl s_client -connect imap.mail.yahoo.com:993
[ssl stuff omitted]
* OK [CAPABILITY IMAP4rev1 ID MOVE NAMESPACE X-ID-ACLID UIDPLUS LITERAL+ XYMHIGHESTMODSEQ AUTH=plain SASL-IR AUTH=PLAIN AUTH=LOGIN AUTH=XYMLOGIN AUTH=XYMPKI AUTH=XYMCOOKIEB64 AUTH=XOAUTH2 AUTH=OAUTHBEARER] IMAP4rev1 Hello
a001 login fred xyzzy
a001 NO [AUTHORIZATIONFAILED] LOGIN Invalid credentials

which makes more sense.

I've tried asking this question on the BTCare forum, but didn't get a helpful reply.

Is mail.btinternet.com behaving brokenly? It doesn't seem to respond according to the IMAP spec (https://www.rfc-editor.org/rfc/rfc3501).


Solution

  • Use -crlf flag to openssl s_client. By default it doesn't send CRLFs, which does not conform to the IMAP requirements, and can cause odd behaviour in some servers.

    This works for me:

    $ openssl s_client -connect mail.btinternet.com:993 -crlf
    [snip]
    a LOGIN fred xyzzy
    * BYE disconnecting
    a NO [AUTHENTICATIONFAILED] LOGIN Invalid credentials
    closed