diff options
author | Brendan Cully <brendan@kublai.com> | 2007-03-31 16:07:36 -0700 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2007-03-31 16:07:36 -0700 |
commit | c6406c3da6d7944dbb709111cdac8ef4c2d2fa35 (patch) | |
tree | 7871dbf7d4a57eafd602fe8e4af5f59798260cf5 /imap/imap.c | |
parent | 410cae7a5163273963420dac072ec4ed4960bc41 (diff) |
Allow IMAP FCC to reconnect if append fails (closes: #890)
Diffstat (limited to 'imap/imap.c')
-rw-r--r-- | imap/imap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/imap/imap.c b/imap/imap.c index 97844107..d788b1ba 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -63,6 +63,7 @@ int imap_access (const char* path, int flags) char buf[LONG_STRING]; char mailbox[LONG_STRING]; char mbox[LONG_STRING]; + int rc; if (imap_parse_path (path, &mx)) return -1; @@ -96,10 +97,10 @@ int imap_access (const char* path, int flags) return -1; } - if (imap_exec (idata, buf, IMAP_CMD_FAIL_OK) < 0) + if ((rc = imap_exec (idata, buf, IMAP_CMD_FAIL_OK)) < 0) { dprint (1, (debugfile, "imap_access: Can't check STATUS of %s\n", mbox)); - return -1; + return rc; } return 0; @@ -341,6 +342,8 @@ IMAP_DATA* imap_conn_find (const ACCOUNT* account, int flags) } if (flags & M_IMAP_CONN_NOSELECT && idata && idata->state >= IMAP_SELECTED) continue; + if (idata && idata->status == IMAP_FATAL) + continue; break; } if (!conn) @@ -771,6 +774,7 @@ int imap_open_mailbox_append (CONTEXT *ctx) char buf[LONG_STRING]; char mailbox[LONG_STRING]; IMAP_MBOX mx; + int rc; if (imap_parse_path (ctx->path, &mx)) return -1; @@ -793,9 +797,12 @@ int imap_open_mailbox_append (CONTEXT *ctx) FREE (&mx.mbox); /* really we should also check for W_OK */ - if (!imap_access (ctx->path, F_OK)) + if ((rc = imap_access (ctx->path, F_OK)) == 0) return 0; + if (rc == -1) + return -1; + snprintf (buf, sizeof (buf), _("Create %s?"), mailbox); if (option (OPTCONFIRMCREATE) && mutt_yesorno (buf, 1) < 1) return -1; |