summaryrefslogtreecommitdiffstats
path: root/mutt.h
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-05-29 10:54:56 -0700
committerKevin McCarthy <kevin@8t8.us>2020-05-31 14:45:34 -0700
commit44711a243ee8fe7dc5e206d0175a5026599275ef (patch)
tree0d3f5ae23bd57227a799afce4fd7dd9b4e67b460 /mutt.h
parent878e261adce03ec65d1e552d1be661deb88c8951 (diff)
Try to automatically reconnect to an open IMAP mailbox on error.
For the Context, change cmd_handle_fatal() to flag idata->status on the error, but not close the mailbox and disconnect. Then have imap_check_mailbox() reconnect when IMAP_REOPEN_ALLOW is set (so the index is prepared to rebuild with all new headers). Try to merge flag, envelope, and attach_del changes back in. Replace the existing Context pointer with the new values, and swap out the idata passed in on success, so we don't continue to work with the wrong idata. The imap_check_mailbox() changes are purposely coded loosely to try and catch all sorts of errors - not just polling and imap_idle errors. Create a new check_mailbox() return code to indicate a reconnect. Display a more appropriate message in the index, but otherwise treat it the same as a REOPEN.
Diffstat (limited to 'mutt.h')
-rw-r--r--mutt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mutt.h b/mutt.h
index b1fe8d64..8d5483b9 100644
--- a/mutt.h
+++ b/mutt.h
@@ -690,6 +690,12 @@ typedef struct alias
short num;
} ALIAS;
+/* Flags for envelope->changed.
+ * Note that additions to this list also need to be added to:
+ * mutt_copy_header()
+ * mutt_merge_envelopes()
+ * imap_reconnect()
+ */
#define MUTT_ENV_CHANGED_IRT (1<<0) /* In-Reply-To changed to link/break threads */
#define MUTT_ENV_CHANGED_REFS (1<<1) /* References changed to break thread */
#define MUTT_ENV_CHANGED_XLABEL (1<<2) /* X-Label edited */