parent->children = node;
continue;
}
+ } else if (strcasecmp(node->name, "INBOX") == 0) {
+ ilist->rebuild_on_missing_inbox = FALSE;
}
if (hash_table_lookup(duplicate_hash, node) == NULL)
hash_table_insert(duplicate_hash, node, node);
if (ilist->call_corruption_callback)
reason = MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_CORRUPTED;
+ else if (ilist->rebuild_on_missing_inbox)
+ reason = MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_NO_INBOX;
else
return 0;
struct mailbox_list_index_sync_context *sync_ctx;
ilist->call_corruption_callback = FALSE;
+ ilist->rebuild_on_missing_inbox = FALSE;
if (mailbox_list_index_sync_begin(list, &sync_ctx) < 0)
return -1;
ilist->path = dir == NULL ? "(in-memory mailbox list index)" :
p_strdup_printf(list->pool, "%s/%s", dir, list->set.list_index_fname);
ilist->index = mail_index_alloc(dir, list->set.list_index_fname);
+ ilist->rebuild_on_missing_inbox =
+ (list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) != 0;
ilist->ext_id = mail_index_ext_register(ilist->index, "list",
sizeof(struct mailbox_list_index_header),
unsigned int corrupted_names_or_parents:1;
unsigned int handling_corruption:1;
unsigned int call_corruption_callback:1;
+ unsigned int rebuild_on_missing_inbox:1;
};
struct mailbox_list_index_iterate_context {
enum mail_storage_list_index_rebuild_reason {
/* Mailbox list index was found to be corrupted. */
MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_CORRUPTED,
+ /* Mailbox list index doesn't have INBOX in an inbox=yes namespace.
+ Rebuild is done to verify whether the user really is an empty new
+ user, or if an existing user's mailbox list index was lost. Because
+ this is called in non-error conditions, the callback shouldn't log
+ any errors or warnings if it didn't find any missing mailboxes. */
+ MAIL_STORAGE_LIST_INDEX_REBUILD_REASON_NO_INBOX,
};
struct mail_storage_module_register {