From f754ff48f92e10ed8cbfb6862e902cf81439a703 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Thu, 31 Aug 2000 08:54:29 +0000 Subject: [PATCH] patch-bac.command-3 --- imap/command.c | 6 +++--- imap/imap.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/imap/command.c b/imap/command.c index 74c531838..f26af035c 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 fa0525acf..21da0e592 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; } -- 2.40.0