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;
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;
}
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;
}
#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))
return 0;
fail:
+ idata->state = IMAP_AUTHENTICATED;
FREE (&mx.mbox);
return -1;
}