[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Office 365 "BAD Command received in Invalid state."



At Wed, 05 Feb 2014 12:18:38 +0000,
Richard Lewis wrote:
> 
> Hi there,
> 
> My employer recently sold out their email provision to Microsoft using
> that company's Office 365 'cloud' offering. This service provides an
> IMAP implementation with which I'm having some problems.
> 
> I regularly find that I can't establish a connection when I first try;
> it takes up to 10s of attempts over several minutes before Wanderlust
> successfully manages to retrieve new message headers. For as long as
> the connection is left open it works fine. Each of the failed attempts
> results in this error message:
> 
> "BAD Command received in Invalid state."
> 
> I have IMAP debugging enabled and have pasted the full log below.
> 
> The Web seems to suggest that this could be a password encryption
> setting problem on the server side. (My employer has not been very
> helpful in attempting to debug this; they (understandly) argue that
> they don't support Wanderlust.) However, it seems from the
> 'capability' response that only PLAIN is supported, so I can't really
> experiment further in that direction. I've also tried switching been
> SSL on port 993 and STARTTLS on port 143; doesn't make any difference.
> 
> Any suggestions what might be going on here?
> 

This looks like a authentification failure: The NAMESPACE command is
only allowed when logged in, the error message indicates that the user
is not in the right state (=logged in).

What about trying this from the command line:

gnutls-cli --starttls <server> -p 143

0x0 LOGIN <user> <password>
0x1 NAMESPACE

?

Best,
  -- David

> Richard
> -- 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Richard Lewis
> j: ironchicken@jabber.earth.li
> @: lewisrichard
> http://www.richardlewis.me.uk/
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> [10:11:48] <- elmo-imap41 capability
> [10:11:48] -> * CAPABILITY IMAP4 IMAP4rev1 LOGINDISABLED STARTTLS UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
> [10:11:48] -> elmo-imap41 OK CAPABILITY completed.
> *elmo-imap41* OK arrived
> [10:11:48] => ((ok nil) (capability (imap4 imap4rev1 logindisabled starttls uidplus children idle namespace literal+)))
> [10:11:48] <- elmo-imap42 starttls
> [10:11:48] -> elmo-imap42 OK Begin TLS negotiation now.
> *elmo-imap42* OK arrived
> [10:11:48] => ((ok nil))
> [10:11:48] <- elmo-imap43 capability
> [10:11:48] -> * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
> [10:11:48] -> elmo-imap43 OK CAPABILITY completed.
> *elmo-imap43* OK arrived
> [10:11:48] => ((ok nil) (capability (imap4 imap4rev1 auth=plain uidplus children idle namespace literal+)))
> NO LOGGING
> NO LOGGING
> NO LOGGING
> NO LOGGING
> [10:11:50] <- elmo-imap45 capability
> [10:11:50] -> * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
> [10:11:50] -> elmo-imap45 OK CAPABILITY completed.
> *elmo-imap45* OK arrived
> [10:11:50] => ((ok nil) (capability (imap4 imap4rev1 auth=plain uidplus children idle namespace literal+)))
> [10:11:50] <- elmo-imap46 namespace
> [10:11:50] -> elmo-imap46 BAD Command received in Invalid state.
> *elmo-imap46* BAD arrived
> [10:11:50] => ((bad (nil "Command received in Invalid state.")))
>