diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-31 08:54:29 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-31 08:54:29 +0000 |
commit | 88ab306fe06e9ce5ff12665b8a102ec5f1a2cad7 (patch) | |
tree | 48a93cdc2a2489dd87f392fd26db64f8aa7067a8 /imap | |
parent | 5ba232a938db666d8c3b09c3c1ee82034fedcc1e (diff) |
patch-bac.command-3
Diffstat (limited to 'imap')
-rw-r--r-- | imap/command.c | 6 | ||||
-rw-r--r-- | imap/imap.c | 26 |
2 files changed, 16 insertions, 16 deletions
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; } |