From: Timo Sirainen Date: Tue, 9 Jan 2024 14:27:47 +0000 (-0500) Subject: lib-storage: Don't allow empty mail_path just because of MAILBOX_LIST_PROP_NO_ROOT X-Git-Tag: 2.4.1~1189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7255027c006d0cf8f26f55e55deda3ed6a385a8;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Don't allow empty mail_path just because of MAILBOX_LIST_PROP_NO_ROOT 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. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 09d0620b03..2aafc3417d 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -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);