]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't keep SETTINGS_EVENT_FILTER_NAME=storage_name in mailbox_list.event
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 29 May 2024 20:28:43 +0000 (23:28 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:13 +0000 (12:34 +0200)
This fixes fts_dovecot, which was wrongly using obox's default fs settings.

src/lib-storage/mail-storage.c

index 0300ccc399f01535706ced621cd42fbad73be643..0c4583c4caf26c61f83d06a1b40d91e5a8c06bc1 100644 (file)
@@ -319,7 +319,7 @@ mail_storage_create_ns_instance(struct mail_namespace *ns,
 static int
 mail_storage_create_list(struct mail_namespace *ns,
                         struct mail_storage *storage_class,
-                        struct event *set_event,
+                        struct event *parent_set_event,
                         enum mail_storage_flags flags,
                         const char *root_path_override,
                         const char *inbox_path_override,
@@ -334,7 +334,7 @@ mail_storage_create_list(struct mail_namespace *ns,
                list_flags |= MAILBOX_LIST_FLAG_NO_DELETES;
 
        struct mailbox_list *list;
-       set_event = event_create(set_event);
+       struct event *set_event = event_create(parent_set_event);
        /* Lookup storage-specific settings, especially to get
           storage-specific defaults for mailbox list settings. */
        event_set_ptr(set_event, SETTINGS_EVENT_FILTER_NAME,
@@ -404,7 +404,11 @@ mail_storage_create_list(struct mail_namespace *ns,
                }
        }
 
-       struct event *event = event_create(set_event);
+       /* Use parent_set_event instead of set_event mainly to avoid
+          permanently having SETTINGS_EVENT_FILTER_NAME=storage_name in
+          mailbox_list->event. This would be wrong, since mailbox_list can
+          support multiple storages. */
+       struct event *event = event_create(parent_set_event);
        event_add_str(event, SETTINGS_EVENT_NAMESPACE_NAME, ns->set->name);
        int ret = mailbox_list_create(event, ns, mail_set, list_flags,
                                      &list, error_r);