From: Thomas Roessler Date: Thu, 31 Aug 2000 08:54:29 +0000 (+0000) Subject: patch-bac.command-3 X-Git-Tag: mutt-1-3-9-rel~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88ab306fe06e9ce5ff12665b8a102ec5f1a2cad7;p=mutt patch-bac.command-3 --- diff --git a/imap/command.c b/imap/command.c index 74c53183..f26af035 100644 --- a/imap/command.c +++ b/imap/command.c @@ -198,10 +198,10 @@ int imap_exec (IMAP_DATA* idata, const char* cmd, int flags) rc = imap_cmd_step (idata); while (rc == IMAP_CMD_CONTINUE); - if (rc != IMAP_CMD_DONE) - return -1; + if (rc == IMAP_CMD_NO && (flags & IMAP_CMD_FAIL_OK)) + return -2; - if (!imap_code (idata->buf)) + if (rc != IMAP_CMD_DONE) { char *pc; diff --git a/imap/imap.c b/imap/imap.c index fa0525ac..21da0e59 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -500,10 +500,10 @@ int imap_open_mailbox (CONTEXT* ctx) snprintf (bufout, sizeof (bufout), "%s %s", ctx->readonly ? "EXAMINE" : "SELECT", buf); - imap_cmd_start (idata, bufout); - idata->state = IMAP_SELECTED; + imap_cmd_start (idata, bufout); + do { char *pc; @@ -550,6 +550,16 @@ int imap_open_mailbox (CONTEXT* ctx) } while (rc == IMAP_CMD_CONTINUE); + if (rc == IMAP_CMD_NO) + { + char *s; + s = imap_next_word (idata->buf); /* skip seq */ + s = imap_next_word (s); /* Skip response */ + mutt_error ("%s", s); + sleep (2); + goto fail; + } + if (rc != IMAP_CMD_DONE) goto fail; @@ -583,17 +593,6 @@ int imap_open_mailbox (CONTEXT* ctx) } #endif - if (!imap_code (idata->buf)) - { - char *s; - s = imap_next_word (idata->buf); /* skip seq */ - s = imap_next_word (s); /* Skip response */ - mutt_error ("%s", s); - idata->state = IMAP_AUTHENTICATED; - sleep (1); - goto fail; - } - if (mutt_bit_isset (idata->capabilities, ACL)) { if (imap_check_acl (idata)) @@ -623,6 +622,7 @@ int imap_open_mailbox (CONTEXT* ctx) return 0; fail: + idata->state = IMAP_AUTHENTICATED; FREE (&mx.mbox); return -1; }