# HG changeset patch # User Timo Sirainen # Date 1504533330 -10800 # Node ID 725057ef25e456fed4ba1f1e7816bb9c0c32fdbb # Parent 6eb5a6930614d9657a64c16496f3038b40a54f82 lib-storage: Optimize INBOX notifications with mailbox_list_index_include_inbox=yes There's no need for special INBOX checks in that case, because INBOX is tracked in the mailbox list index the same as any other mailbox. diff -r 6eb5a6930614 -r 725057ef25e4 src/lib-storage/list/mailbox-list-index-notify.c --- a/src/lib-storage/list/mailbox-list-index-notify.c Mon Sep 04 19:37:12 2017 +0300 +++ b/src/lib-storage/list/mailbox-list-index-notify.c Mon Sep 04 16:55:30 2017 +0300 @@ -101,9 +101,14 @@ inotify->subscriptions = mailbox_tree_dup(list->subscriptions); } inotify->list_log_path = i_strdup(ilist->index->log->filepath); - if ((list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) != 0 && - mailbox_list_get_path(list, "INBOX", MAILBOX_LIST_PATH_TYPE_INDEX, - &index_dir) > 0) { + if (list->mail_set->mailbox_list_index_include_inbox) { + /* INBOX can be handled also using mailbox list index */ + } else if ((list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) == 0) { + /* no INBOX in this namespace */ + } else if (mailbox_list_get_path(list, "INBOX", MAILBOX_LIST_PATH_TYPE_INDEX, + &index_dir) <= 0) { + /* no indexes for INBOX? can't handle it */ + } else { /* FIXME: annoyingly hardcoded filename. */ inotify->inbox_log_path = i_strdup_printf( "%s/"MAIL_INDEX_PREFIX".log", index_dir);