From: Timo Sirainen Date: Thu, 11 Sep 2025 18:37:38 +0000 (+0300) Subject: lib-storage: Fix subscription refresh when it autocreates a namespace X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6af8b5e589f071696e63eec76e88ca7cbc68239f;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix subscription refresh when it autocreates a namespace If there's a shared/user/foo subscription, it might create shared/user/ namespace. In that case the subscription should go to shared/user/ namespace, not shared/. --- diff --git a/src/lib-storage/list/mailbox-list-subscriptions.c b/src/lib-storage/list/mailbox-list-subscriptions.c index 31e137d7bc..272d764ad2 100644 --- a/src/lib-storage/list/mailbox-list-subscriptions.c +++ b/src/lib-storage/list/mailbox-list-subscriptions.c @@ -66,6 +66,12 @@ mailbox_list_subscription_fill_one(struct mailbox_list *list, one easy way is to just ask to join a reference and pattern */ (void)mailbox_list_join_refpattern(ns->list, ns_name, ""); + /* If the namespace changes to the newly created one, start + the lookup all over again. */ + struct mail_namespace *ns2 = + mail_namespace_find_unsubscribable(namespaces, ns_name); + if (ns != ns2) + return mailbox_list_subscription_fill_one(list, src_list, name); } /* When listing pub/ namespace, skip over the namespace