]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't allow empty mail_path just because of MAILBOX_LIST_PROP_NO_ROOT
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 9 Jan 2024 14:27:47 +0000 (09:27 -0500)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
For example fs layout now has MAILBOX_LIST_PROP_NO_ROOT enabled, because
pop3c uses fs layout, even though it may not have a mail_path set. But
this shouldn't disable empty mail_path check for sdbox, which would crash
if it is attempted.

src/lib-storage/mail-storage.c

index 09d0620b03dab761c8d88ab401d492d9a997ac77..2aafc3417d630b01c5799db9dcc670b715de8e8b 100644 (file)
@@ -390,19 +390,12 @@ mail_storage_create_list(struct mail_namespace *ns,
 
        if (mail_set->mail_path[0] == '\0') {
                /* no root directory given. is this allowed? */
-               const struct mailbox_list *list;
-
-               list = mail_set->mailbox_list_layout[0] == '\0' ? NULL :
-                       mailbox_list_find_class(mail_set->mailbox_list_layout);
                if (storage_class == NULL &&
                    (flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) == 0) {
                        /* autodetection should take care of this */
                } else if (storage_class != NULL &&
                           (storage_class->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0) {
                        /* root not required for this storage */
-               } else if (list != NULL &&
-                          (list->props & MAILBOX_LIST_PROP_NO_ROOT) != 0) {
-                       /* root not required for this layout */
                } else {
                        *error_r = "Root mail directory not given";
                        settings_free(mail_set);