diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap4/camel-imap4-engine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c index 059c7dbe22..bd5ebfff07 100644 --- a/camel/providers/imap4/camel-imap4-engine.c +++ b/camel/providers/imap4/camel-imap4-engine.c @@ -978,7 +978,15 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke if (token->token == CAMEL_IMAP4_TOKEN_ATOM) { if (!strcmp ("BYE", token->v.atom)) { /* we don't care if we fail here, either way we've been disconnected */ - camel_imap4_engine_parse_resp_code (engine, NULL); + if (camel_imap4_engine_next_token (engine, token, NULL) == 0) { + if (token->token == '[') { + camel_imap4_stream_unget_token (engine->istream, token); + camel_imap4_engine_parse_resp_code (engine, NULL); + } else { + camel_imap4_engine_line (engine, NULL, NULL, NULL); + } + } + engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED; /* FIXME: emit a "disconnected" signal for our Store? |