{
struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT(list);
struct mail_storage *const *storagep;
+ enum mail_storage_list_index_rebuild_reason reason;
int ret = 0;
- if (!ilist->call_corruption_callback)
+ if (ilist->call_corruption_callback)
+ reason = MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_CORRUPTED;
+ else
return 0;
/* make sure we don't recurse */
ilist->handling_corruption = TRUE;
array_foreach(&list->ns->all_storages, storagep) {
- if ((*storagep)->v.list_index_corrupted != NULL) {
- if ((*storagep)->v.list_index_corrupted(*storagep) < 0)
+ if ((*storagep)->v.list_index_rebuild != NULL) {
+ if ((*storagep)->v.list_index_rebuild(*storagep, reason) < 0)
ret = -1;
else {
/* FIXME: implement a generic handler that
#define MAIL_SHARED_STORAGE_NAME "shared"
+enum mail_storage_list_index_rebuild_reason {
+ /* Mailbox list index was found to be corrupted. */
+ MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_CORRUPTED,
+};
+
struct mail_storage_module_register {
unsigned int id;
};
const char *vname,
enum mailbox_flags flags);
int (*purge)(struct mail_storage *storage);
- /* Called when mailbox list index corruption has been detected.
+ /* Called when mailbox list index rebuild is requested.
The callback should add any missing mailboxes to the list index.
Returns 0 on success, -1 on temporary failure that didn't properly
- fix the index. */
- int (*list_index_corrupted)(struct mail_storage *storage);
+ rebuild the index. */
+ int (*list_index_rebuild)(struct mail_storage *storage,
+ enum mail_storage_list_index_rebuild_reason reason);
};
union mail_storage_module_context {