]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: old-set-parser - Move removed settings into an removed_settings[] array
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 3 Apr 2023 11:21:22 +0000 (14:21 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
src/config/old-set-parser.c

index e93a51da4be9f508c732aed344bc412a4bc55c9b..242d6aa638e72e5b5b5036f63b9e40de8a1d780e 100644 (file)
@@ -45,6 +45,18 @@ static const struct config_filter managesieve_filter = {
        .service = "sieve"
 };
 
+static const struct {
+       const char *key;
+} removed_settings[] = {
+       { .key = "login_dir", },
+       { .key = "license_checksum", },
+       { .key = "dbox_rotate_min_size", },
+       { .key = "dbox_rotate_days", },
+       { .key = "director_consistent_hashing", },
+       { .key = "mail_log_max_lines_per_sec", },
+       { .key = "maildir_copy_preserve_filename", },
+};
+
 static void ATTR_FORMAT(2, 3)
 obsolete(struct config_parser_context *ctx, const char *str, ...)
 {
@@ -274,15 +286,11 @@ old_settings_handle_root(struct config_parser_context *ctx,
                return TRUE;
        }
 
-       if (strcmp(key, "login_dir") == 0 ||
-           strcmp(key, "license_checksum") == 0 ||
-           strcmp(key, "dbox_rotate_min_size") == 0 ||
-           strcmp(key, "dbox_rotate_days") == 0 ||
-           strcmp(key, "director_consistent_hashing") == 0 ||
-           strcmp(key, "mail_log_max_lines_per_sec") == 0 ||
-           strcmp(key, "maildir_copy_preserve_filename") == 0) {
-               obsolete(ctx, "%s has been removed", key);
-               return TRUE;
+       for (unsigned int i = 0; i < N_ELEMENTS(removed_settings); i++) {
+               if (strcmp(removed_settings[i].key, key) == 0) {
+                       obsolete(ctx, "%s has been removed", key);
+                       return TRUE;
+               }
        }
        if (strcmp(key, "auth_worker_max_count") == 0) {
                obsolete(ctx,