From: Kevin McCarthy Date: Fri, 22 Sep 2017 18:12:25 +0000 (-0700) Subject: Close the imap socket for the selected mailbox on error. X-Git-Tag: mutt-1-9-1-rel~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1eab777404c11dbdd3d4eedf1477adebf040cac7;p=mutt Close the imap socket for the selected mailbox on error. The new $imap_poll_timeout calls the cmd_handle_fatal() error handler on timeout, which is supposed to close and cleanup. However, for the currently selected mailbox, the error handler was not closing the socket after closing up the mailbox. This left extra SSL/GnuTLS data around and was causing errors on an attempt to reconnect. Thanks to Fabian Groffen for reporting the issue. --- diff --git a/imap/command.c b/imap/command.c index 891efb74..8529d9de 100644 --- a/imap/command.c +++ b/imap/command.c @@ -464,6 +464,7 @@ static void cmd_handle_fatal (IMAP_DATA* idata) (idata->reopen & IMAP_REOPEN_ALLOW)) { mx_fastclose_mailbox (idata->ctx); + mutt_socket_close (idata->conn); mutt_error (_("Mailbox closed")); mutt_sleep (1); idata->state = IMAP_DISCONNECTED;