]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't accept 0 as meaning unlimited anymore in mail_vsize_bg_after_count
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 27 Jan 2026 14:17:29 +0000 (14:17 +0000)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 18 Feb 2026 07:37:06 +0000 (07:37 +0000)
src/lib-storage/index/index-mailbox-size.c
src/lib-storage/mail-storage-settings.c

index cae15c6c8153419327c4d6f8b3ff11081beafa66..b2283b2b7187c8549ad5b9aedcef9b66bccd1fc5 100644 (file)
@@ -323,8 +323,6 @@ index_mailbox_vsize_hdr_add_missing(struct mailbox_vsize_update *update,
                                         MAIL_FETCH_VIRTUAL_SIZE, NULL);
        if (!require_result)
                mails_left = 0;
-       else if (update->box->storage->set->mail_vsize_bg_after_count == 0)
-               mails_left = UINT_MAX;
        else
                mails_left = update->box->storage->set->mail_vsize_bg_after_count;
 
index 1538fbe04ef9769829d32eb544f09f61fcc1c1fe..18162204aefa8ee119906f479c31f292ddb18817 100644 (file)
@@ -144,7 +144,7 @@ const struct mail_storage_settings mail_storage_default_settings = {
        .mail_max_keyword_length = 50,
        .mail_max_lock_timeout = 0,
        .mail_temp_scan_interval = 7*24*60*60,
-       .mail_vsize_bg_after_count = 0,
+       .mail_vsize_bg_after_count = SET_UINT_UNLIMITED,
        .mail_sort_max_read_count = SET_UINT_UNLIMITED,
        .mail_save_crlf = FALSE,
        .mail_fsync = "optimized:never:always",
@@ -627,6 +627,10 @@ mail_storage_settings_ext_check(struct event *event, void *_set, pool_t pool,
                *error_r = "mail_sort_max_read_count must not be 0";
                return FALSE;
        }
+       if (set->mail_vsize_bg_after_count == 0) {
+               *error_r = "mail_vsize_bg_after_count must not be 0";
+               return FALSE;
+       }
 
        if (strcmp(set->mail_fsync, "optimized") == 0)
                set->parsed_fsync_mode = FSYNC_MODE_OPTIMIZED;