From: Timo Sirainen Date: Thu, 31 Jul 2025 12:47:53 +0000 (+0300) Subject: config: Assume config parser end hook wants to change default settings X-Git-Tag: 2.4.2~581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=053c9df0a1e7570f6e794bc122134137ed5aada6;p=thirdparty%2Fdovecot%2Fcore.git config: Assume config parser end hook wants to change default settings This is what Pigeonhole wants at least. This was already happening a bit accidentally. Make thie explicit, because the next commit removes the accidental method. --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 91ace447c1..c830f0d24f 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -1861,8 +1861,15 @@ config_all_parsers_check(struct config_parser_context *ctx, int ret = 0; if (hook_config_parser_end != NULL && - (flags & CONFIG_PARSE_FLAG_EXTERNAL_HOOKS) != 0) + (flags & CONFIG_PARSE_FLAG_EXTERNAL_HOOKS) != 0) { + /* Assume the hooks want to update default settings */ + struct config_filter_parser *defaults_parser = + array_idx_elem(&ctx->all_filter_parsers, 1); + i_assert(config_filter_is_empty_defaults(&defaults_parser->filter)); + ctx->cur_section->filter_parser = defaults_parser; + ret = hook_config_parser_end(ctx, new_config, event, error_r); + } /* Run check_func()s for each filter independently. If you have protocol imap { ... local { ... } } blocks, it's going to check the