changeset 13668:d0a071b6847c

indexer-worker: If indexes are disabled for a mailbox, do nothing but log a message.
author Timo Sirainen <tss@iki.fi>
date Mon, 07 Nov 2011 22:17:15 +0200
parents 9da49294f49d
children 08afc14abc21
files src/indexer/master-connection.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/indexer/master-connection.c	Mon Nov 07 20:45:55 2011 +0200
+++ b/src/indexer/master-connection.c	Mon Nov 07 22:17:15 2011 +0200
@@ -118,7 +118,7 @@
 	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 @@
 		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.