]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
indexer-worker: If indexes are disabled for a mailbox, do nothing but log a message.
authorTimo Sirainen <tss@iki.fi>
Mon, 7 Nov 2011 20:17:15 +0000 (22:17 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 7 Nov 2011 20:17:15 +0000 (22:17 +0200)
src/indexer/master-connection.c

index a4b65ca23461d3f89604851f0d49f2267e71bcfc..67f8c96bef5299a63fbfc076dfab6082d3948322 100644 (file)
@@ -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.