+
+int mx_rebuild_cache (void) {
+#ifndef USE_HCACHE
+ mutt_error (_("Support for header caching was not build in."));
+ return (1);
+#else
+ int i = 0, magic = 0;
+ CONTEXT* ctx = NULL;
+ BUFFY* b = NULL;
+
+ if (list_empty(Incoming)) {
+ mutt_error (_("No mailboxes defined."));
+ return (1);
+ }
+
+ for (i = 0; i < Incoming->length; i++) {
+ b = (BUFFY*) Incoming->data[i];
+ magic = mx_get_magic (b->path);
+ if (magic != M_MAILDIR && magic != M_MH
+#ifdef USE_IMAP
+ && magic != M_IMAP
+#endif
+ )
+ continue;
+ sidebar_set_current (b->path);
+ sidebar_draw (CurrentMenu);
+ if ((ctx = mx_open_mailbox (b->path,
+ M_READONLY | M_NOSORT | M_COUNT,
+ NULL)) != NULL)
+ mx_close_mailbox (ctx, 0);
+ }
+ mutt_clear_error ();
+
+ if (Context && Context->path)
+ sidebar_set_current (Context->path);
+ sidebar_draw (CurrentMenu);
+
+ return (0);
+#endif
+}