]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add "namespace" field to mailbox event
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 1 Jun 2023 20:10:49 +0000 (23:10 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:21:56 +0000 (14:21 +0200)
src/lib-storage/fail-mailbox.c
src/lib-storage/index/index-storage.c
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c

index 0c97f159076e0291db8ad5e28c2220359b52b211..20fe2ed30d68d1b7772c0f85caec9b19ef16307d 100644 (file)
@@ -331,8 +331,8 @@ fail_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
        box->pool = pool;
        box->flags = flags;
 
-       box->event = mail_storage_mailbox_create_event(box->storage->event,
-                                                      box->vname);
+       box->event = mail_storage_mailbox_create_event(storage->event,
+                                                      list, box->vname);
        p_array_init(&box->search_results, pool, 16);
        p_array_init(&box->module_contexts, pool, 5);
        return box;
index bfb497e768d63ef84e8af62bc191ef308ddb8e99..b587b76f0cb1c3a49053f6801457ab4c8f087485 100644 (file)
@@ -408,7 +408,7 @@ void index_storage_mailbox_alloc(struct mailbox *box, const char *vname,
        box->flags = flags;
        box->index_prefix = p_strdup(box->pool, index_prefix);
        box->event = mail_storage_mailbox_create_event(box->storage->event,
-                                                      box->vname);
+                                                      box->list, box->vname);
 
        p_array_init(&box->search_results, box->pool, 16);
        array_create(&box->module_contexts,
index 96d73e54877c2e0fef8690dd720b5814251baa68..f1b3f97fb3949f2c566841c8b581018aabb0cde4 100644 (file)
@@ -928,7 +928,8 @@ static inline const char *mailbox_name_sanitize(const char *name)
 }
 
 struct event *
-mail_storage_mailbox_create_event(struct event *parent, const char *vname);
+mail_storage_mailbox_create_event(struct event *parent,
+                                 struct mailbox_list *list, const char *vname);
 
 /* for unit testing */
 int mailbox_verify_name(struct mailbox *box);
index c84e7dce8c2f4c90ed20a092fa17eea495edfa0a..d9fc0f7032c37b00df4b10f77d7da54143ed7351 100644 (file)
@@ -3371,13 +3371,14 @@ mail_storage_settings_to_index_flags(const struct mail_storage_settings *set)
        return index_flags;
 }
 
-
 struct event *
-mail_storage_mailbox_create_event(struct event *parent, const char* vname)
+mail_storage_mailbox_create_event(struct event *parent,
+                                 struct mailbox_list *list, const char *vname)
 {
        struct event *event = event_create(parent);
        event_add_category(event, &event_category_mailbox);
-       event_add_str(event, "mailbox", vname);
+       event_add_str(event, "namespace", list->ns->set->name);
+
        event_drop_parent_log_prefixes(event, 1);
        event_set_append_log_prefix(event, t_strdup_printf(
                "Mailbox %s: ", mailbox_name_sanitize(vname)));