It is not going to work anyway and it will cause a crash when the IMAP sync code
subsequently drops those namespaces as part of mail_user_drop_useless_namespaces().
This does not drop the earlier created mailbox_list_notify object, causing its
mailbox list index view object to remain open. This causes the following panic:
Panic: Leaked view for index <path>/dovecot.list.index: Opened in mailbox-list-index-notify.c:142
size_t cur_len, name_len = strlen(name);
char ns_sep = mail_namespace_get_sep(ns);
+ if (mail_namespace_is_removable(ns)) {
+ /* exclude removable namespaces */
+ return;
+ }
+
if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
!str_begins(name, "INBOX") &&
strncasecmp(name, "INBOX", 5) == 0 &&