]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: storage - Use fts_settings for autoindex_max_recent_msgs
authorMarco Bettini <marco.bettini@open-xchange.com>
Fri, 1 Dec 2023 11:05:42 +0000 (11:05 +0000)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
src/plugins/fts/fts-storage.c

index 0f6894a2dac7ca0218c64dadf7b4a8854043ec67..2eb2811b3c21518f4b223981131624dcb23b385d 100644 (file)
@@ -632,9 +632,9 @@ static void fts_transaction_rollback(struct mailbox_transaction_context *t)
 static void fts_queue_index(struct mailbox *box)
 {
        struct mail_user *user = box->storage->user;
+       struct fts_mailbox *fbox = FTS_CONTEXT_REQUIRE(box);
        string_t *str = t_str_new(256);
-       const char *path, *value;
-       unsigned int max_recent_msgs;
+       const char *path;
        int fd;
 
        path = t_strconcat(user->set->base_dir, "/"INDEXER_SOCKET_NAME, NULL);
@@ -644,16 +644,12 @@ static void fts_queue_index(struct mailbox *box)
                return;
        }
 
-       value = mail_user_plugin_getenv(user, "fts_autoindex_max_recent_msgs");
-       if (value == NULL || str_to_uint(value, &max_recent_msgs) < 0)
-               max_recent_msgs = 0;
-
        str_append(str, INDEXER_HANDSHAKE);
        str_append(str, "APPEND\t0\t");
        str_append_tabescaped(str, user->username);
        str_append_c(str, '\t');
        str_append_tabescaped(str, box->vname);
-       str_printfa(str, "\t%u", max_recent_msgs);
+       str_printfa(str, "\t%u", fbox->set->autoindex_max_recent_msgs);
        str_append_c(str, '\t');
        str_append_tabescaped(str, box->storage->user->session_id);
        str_append_c(str, '\n');