diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 874230a64..2f6a3d10b 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -68,16 +68,14 @@ public class ImapResponseParser { private void readTokens(ImapResponse response) throws IOException { response.clear(); - Object token; + String firstToken = (String) readToken(response); - response.add(firstToken); - skipIfSpace(); - if (isStatusResponse(firstToken)) { parseStatusResponse(response); } else { + Object token; while ((token = readToken(response)) != null) { if (!(token instanceof ImapList)) { response.add(token); @@ -92,6 +90,8 @@ public class ImapResponseParser { void parseStatusResponse(ImapResponse parent) throws IOException { + skipIfSpace(); + int next = mIn.peek(); if (next == '[') { parseSequence(parent);