]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: Ensure pop3c index directory is autocreated
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 29 May 2018 08:53:15 +0000 (11:53 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 4 Jun 2018 11:05:53 +0000 (14:05 +0300)
Otherwise we might think that the box has been unexpectedly
autodeleted and pop3_migration will fail.

Broken by 91ee70ed04d33fecd7fc94621f236013d520d7b3

src/lib-storage/index/pop3c/pop3c-storage.c

index 4f3f104a360ede08d704118430657966e2503df3..60c0816b3dbcfddd6c0aa926b2f1e62724c86fa2 100644 (file)
@@ -87,18 +87,15 @@ pop3c_client_create_from_set(struct mail_storage *storage,
 }
 
 static void
-pop3c_storage_get_list_settings(const struct mail_namespace *ns,
+pop3c_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
                                struct mailbox_list_settings *set)
 {
        set->layout = MAILBOX_LIST_NAME_FS;
        if (set->root_dir != NULL && *set->root_dir != '\0' &&
            set->index_dir == NULL) {
-               /* we don't really care about root_dir, but we
-                  just need to get index_dir autocreated.
-                  it happens when index_dir differs from root_dir. */
+              /* we don't really care about root_dir, but we
+                 just need to get index_dir autocreated. */
                set->index_dir = set->root_dir;
-               set->root_dir = p_strconcat(ns->user->pool,
-                                           set->root_dir, "/.", NULL);
        }
 }
 
@@ -115,6 +112,7 @@ pop3c_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
        mbox->box.pool = pool;
        mbox->box.storage = storage;
        mbox->box.list = list;
+       mbox->box.list->props |= MAILBOX_LIST_PROP_AUTOCREATE_DIRS;
        mbox->box.mail_vfuncs = &pop3c_mail_vfuncs;
        mbox->storage = POP3C_STORAGE(storage);