]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: old-set-parser - Move imap_id_log handling to removed_settings[]
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 3 Apr 2023 11:28:28 +0000 (14:28 +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 3afb0b88ef6265d072b1ca9b215f20a05df14fa7..c54b92f7ea304843ddf5c5bd1e0ff6c68ffc0787 100644 (file)
@@ -47,6 +47,7 @@ static const struct config_filter managesieve_filter = {
 
 static const struct {
        const char *key;
+       const char *details;
        bool fail_if_set;
 } removed_settings[] = {
        { .key = "login_dir", },
@@ -59,6 +60,7 @@ static const struct {
        { .key = "ssl_parameters_regenerate", },
        { .key = "ssl_dh_parameters_length", },
        { .key = "login_access_sockets", .fail_if_set = TRUE, },
+       { .key = "imap_id_log", .details = "Use event exporter for the 'imap_id_received' event instead.", },
 };
 
 static void ATTR_FORMAT(2, 3)
@@ -290,7 +292,9 @@ old_settings_handle_root(struct config_parser_context *ctx,
                        if (removed_settings[i].fail_if_set &&
                            value != NULL && *value != '\0')
                                i_fatal("%s is no longer supported", key);
-                       obsolete(ctx, "%s has been removed", key);
+                       obsolete(ctx, "%s has been removed.%s", key,
+                                removed_settings[i].details == NULL ? "" :
+                                t_strconcat(" ", removed_settings[i].details, NULL));
                        return TRUE;
                }
        }
@@ -359,13 +363,6 @@ old_settings_handle_root(struct config_parser_context *ctx,
                                         value);
                return TRUE;
        }
-       if (strcmp(key, "imap_id_log") == 0) {
-               obsolete(ctx,
-                        "'imap_id_log' has been removed. Use event exporter "
-                        "for the 'imap_id_received' event instead.");
-               return TRUE;
-       }
-
        return FALSE;
 }