From: Timo Sirainen Date: Mon, 7 Nov 2011 20:17:15 +0000 (+0200) Subject: indexer-worker: If indexes are disabled for a mailbox, do nothing but log a message. X-Git-Tag: 2.1.beta1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4605fd7e1fd4ff1fecb8494696fb3604cff46cf5;p=thirdparty%2Fdovecot%2Fcore.git indexer-worker: If indexes are disabled for a mailbox, do nothing but log a message. --- diff --git a/src/indexer/master-connection.c b/src/indexer/master-connection.c index a4b65ca234..67f8c96bef 100644 --- a/src/indexer/master-connection.c +++ b/src/indexer/master-connection.c @@ -118,7 +118,7 @@ index_mailbox(struct master_connection *conn, struct mail_user *user, struct mail_namespace *ns; struct mailbox *box; struct mailbox_status status; - const char *errstr; + const char *path, *errstr; enum mail_error error; enum mailbox_sync_flags sync_flags = MAILBOX_SYNC_FLAG_FULL_READ; int ret = 0; @@ -129,6 +129,13 @@ index_mailbox(struct master_connection *conn, struct mail_user *user, return -1; } + path = mailbox_list_get_path(ns->list, mailbox, + MAILBOX_LIST_PATH_TYPE_INDEX); + if (*path == '\0') { + i_info("Indexes disabled for Mailbox %s, skipping", mailbox); + return 0; + } + box = mailbox_alloc(ns->list, mailbox, 0); if (max_recent_msgs != 0) { /* index only if there aren't too many recent messages.