# HG changeset patch # User Timo Sirainen # Date 1500918505 -10800 # Node ID 83f93173dadb8a6a5068ffe89a59ba69124da737 # Parent 5de2bae83c937d84ebe2ab748f2aa7f6e575ea75 lib-storage: If ITERINDEX is set, delay checking whether mail root exists In future this could be done even without ITERINDEX. It's not done yet, since it might break backwards compatibility with some systems. diff -r 5de2bae83c93 -r 83f93173dadb src/lib-storage/mail-storage.c --- a/src/lib-storage/mail-storage.c Mon Sep 04 17:48:52 2017 +0300 +++ b/src/lib-storage/mail-storage.c Mon Jul 24 20:48:25 2017 +0300 @@ -286,24 +286,18 @@ } autocreate = (flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) == 0; + if (autocreate && list->set.iter_from_index_dir) { + /* If the directories don't exist, we'll just autocreate them + later. FIXME: Make this the default in v2.3 even when + ITERINDEX isn't used. */ + return 0; + } ret = mail_storage_verify_root(root_dir, type_name, autocreate, error_r); if (ret == 0) { - const char *mail_root_dir; - - if (!list->set.iter_from_index_dir) - mail_root_dir = root_dir; - else if (!mailbox_list_get_root_path(list, - MAILBOX_LIST_PATH_TYPE_MAILBOX, &mail_root_dir)) - i_unreached(); - ret = mailbox_list_try_mkdir_root(list, mail_root_dir, + ret = mailbox_list_try_mkdir_root(list, root_dir, MAILBOX_LIST_PATH_TYPE_MAILBOX, error_r); } - if (ret == 0 && list->set.iter_from_index_dir) { - ret = mailbox_list_try_mkdir_root(list, root_dir, - MAILBOX_LIST_PATH_TYPE_INDEX, - error_r); - } return ret < 0 ? -1 : 0; }