return -1;
}
}
+ if ((box->flags & MAILBOX_FLAG_FSCK) != 0) {
+ if (mail_index_fsck(box->index) < 0) {
+ mailbox_set_index_error(box);
+ return -1;
+ }
+ }
box->cache = mail_index_get_cache(box->index);
index_cache_register_defaults(box);
/* Mailbox is created implicitly if it does not exist. */
MAILBOX_FLAG_AUTO_CREATE = 0x1000,
/* Mailbox is subscribed to implicitly when it is created automatically */
- MAILBOX_FLAG_AUTO_SUBSCRIBE = 0x2000
+ MAILBOX_FLAG_AUTO_SUBSCRIBE = 0x2000,
+ /* Run fsck for mailbox index before doing anything else. This may be
+ useful in fixing index corruption errors that aren't otherwise
+ detected and that are causing the full mailbox opening to fail. */
+ MAILBOX_FLAG_FSCK = 0x4000,
};
enum mailbox_feature {