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

index 9d85a8c5c98a6f5857670ce2f1cf63666540fdd9..393f6bbe90bdb647371ad4bee4213c817b4d5c66 100644 (file)
@@ -639,6 +639,13 @@ mail_storage_settings_ext_check(struct event *event, void *_set, pool_t pool,
        if (set->mail_cache_max_header_name_length == SET_UINT_UNLIMITED)
                set->mail_cache_max_header_name_length = 0;
 
+       if (set->mail_cache_max_headers_count == 0) {
+               *error_r = "mail_cache_max_headers_count must not be 0";
+               return FALSE;
+       }
+       if (set->mail_cache_max_headers_count == SET_UINT_UNLIMITED)
+               set->mail_cache_max_headers_count = 0;
+
        if (strcmp(set->mail_fsync, "optimized") == 0)
                set->parsed_fsync_mode = FSYNC_MODE_OPTIMIZED;
        else if (strcmp(set->mail_fsync, "never") == 0)