]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Improve comment about self-referencing keys expansion.
authorsergey.kitov <sergey.kitov@open-xchange.com>
Thu, 15 May 2025 09:18:34 +0000 (12:18 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 19 May 2025 08:06:55 +0000 (08:06 +0000)
src/config/config-parser.c

index 5f2d85466905078525c25d0355759f8f58f52e23..389640721ecf42463b5ff3b9f6f6000ebe04c02a 100644 (file)
@@ -2450,9 +2450,15 @@ static int config_write_keyvariable(struct config_parser_context *ctx,
                else
                        var_name = t_strdup_until(value, var_end);
                var_is_set = str_begins(var_name, "$SET:", &set_name);
-               /* expand_values=TRUE for "key = $SET:key stuff".
-                  we'll always expand it so that doveconf -n can give
-                  usable output */
+               /* Always expand values when value refers to the variable itself, e.g.:
+
+                  login_greeting = Hello
+                  login_greeting = $SET:login_greeting world
+
+                  Always show this as "Hello world" output in doveconf.
+                  If we didn't expand it, it would be visible only as
+                  "$SET:login_greeting world",
+                  hiding the "Hello" string entirely. */
                expand_values = ctx->expand_values ||
                        (var_is_set && strcmp(key, set_name) == 0);