]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: cmd-notify - Do not try to notify for removable namespaces.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sun, 5 Jul 2020 10:16:06 +0000 (12:16 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 4 Aug 2020 16:16:42 +0000 (18:16 +0200)
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

src/imap/cmd-notify.c

index a378e39d72cb9211355bb350f48f2030a846280b..5c7564c49eaa4f80a67bdeeeeda474c1a75f4da2 100644 (file)
@@ -156,6 +156,11 @@ cmd_notify_add_mailbox(struct imap_notify_context *ctx,
        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 &&