From 5679b5d51264fb7353b09f87441356d00aeba37e Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Mon, 14 Jul 2003 12:19:07 +0000 Subject: [PATCH] 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. --- imap/command.c | 5 +++++ imap/imap.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/imap/command.c b/imap/command.c index 39a5bd076..71b4b8798 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 7093a4084..36fde9e12 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 */ -- 2.40.0