- make imap_reconnect() work if server closes connection without muttng noting it (waiting within queries, etc.) (produces lots of errors and warnings so that it's ugly but it works) (real fix still to come)
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@332
e385b8ad-14ed-0310-8656-
cc95a2468c6d
int outlen;
int rc;
+ if (!idata) {
+ mutt_error (_("No mailbox is open."));
+ mutt_sleep (1);
+ return (-1);
+ }
+
if (idata->status == IMAP_FATAL) {
cmd_handle_fatal (idata);
return -1;
idata->reopen |= IMAP_EXPUNGE_EXPECTED;
if (imap_exec (idata, "EXPUNGE", 0) != 0) {
imap_error (_("imap_sync_mailbox: EXPUNGE failed"), idata->cmd.buf);
- rc = -1;
+ rc = imap_reconnect (ctx);
goto out;
}
}
if (ctx) {
if (ctx->locked)
lock = 0;
- if (MX_COMMAND(ctx->magic-1,mx_check_mailbox))
+ if (MX_IDX(ctx->magic-1) && MX_COMMAND(ctx->magic-1,mx_check_mailbox))
return (MX_COMMAND(ctx->magic-1,mx_check_mailbox)(ctx, index_hint, lock));
}