From: Brendan Cully Date: Mon, 14 Jul 2003 12:19:07 +0000 (+0000) Subject: On Sunday, 13 July 2003 at 18:09, Brendan Cully wrote: X-Git-Tag: pre-type-punning-patch~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5d7cea3f7a94268bcfd0b2d843b97d59e4918e3;p=mutt On Sunday, 13 July 2003 at 18:09, Brendan Cully wrote: > The attached patch should help when the connection to your postponed > folder times out and you can't reconnect without restarting mutt. I'd > like anyone who has that problem to try it and let me know how it > works. I dug a little deeper. The attached patch seems to work better. It complains the first time you try to recall a message, but works the second. --- diff --git a/imap/command.c b/imap/command.c index 39a5bd07..71b4b879 100644 --- a/imap/command.c +++ b/imap/command.c @@ -288,6 +288,11 @@ static void cmd_handle_fatal (IMAP_DATA* idata) mutt_error (_("Mailbox closed")); mutt_sleep (1); idata->state = IMAP_DISCONNECTED; + } + + if (idata->state != IMAP_SELECTED) + { + idata->state = IMAP_DISCONNECTED; idata->status = 0; } } diff --git a/imap/imap.c b/imap/imap.c index 7093a408..36fde9e1 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -680,7 +680,8 @@ int imap_open_mailbox (CONTEXT* ctx) return 0; fail: - idata->state = IMAP_AUTHENTICATED; + if (idata->state == IMAP_SELECTED) + idata->state = IMAP_AUTHENTICATED; fail_noidata: FREE (&mx.mbox); return -1; @@ -706,7 +707,7 @@ int imap_open_mailbox_append (CONTEXT *ctx) conn = idata->conn; ctx->magic = M_IMAP; - ctx->data = (void *) idata; + ctx->data = idata; /* check mailbox existance */