hook_config_parser_begin(&ctx);
} T_END;
+ if ((flags & CONFIG_PARSE_FLAG_DEFAULT_VERSION) != 0) {
+ /* Use default settings. Set dovecot_storage_version to the
+ latest version, so it won't cause a failure.
+
+ When building from git we don't know the latest version, so
+ just use 9999. The version validity checks are disabled for
+ git builds, so this should work. */
+ const char *version = version_is_valid(DOVECOT_VERSION) ?
+ DOVECOT_VERSION : "9999";
+ if (config_apply_exact_line(&ctx, NULL, "dovecot_storage_version",
+ version) < 0)
+ i_panic("Couldn't set default dovecot_storage_version: %s", ctx.error);
+ }
+
internal.path = "Internal config_import";
ctx.cur_input->input = config_import == NULL ?
i_stream_create_from_data("", 0) :
CONFIG_PARSE_FLAG_MERGE_DEFAULT_FILTERS = BIT(9),
/* Ignore unknown settings in the config file. */
CONFIG_PARSE_FLAG_IGNORE_UNKNOWN = BIT(10),
+ /* Executing "doveconf -dF" - add default dovecot_storage_version
+ setting. */
+ CONFIG_PARSE_FLAG_DEFAULT_VERSION = BIT(11),
};
/* Used to track changed settings for a setting_parser_info. Initially only
flags |= CONFIG_PARSE_FLAG_DELAY_ERRORS;
if (exec_args == NULL)
flags |= CONFIG_PARSE_FLAG_EXTERNAL_HOOKS;
+ else if (dump_defaults)
+ flags |= CONFIG_PARSE_FLAG_DEFAULT_VERSION;
T_BEGIN {
ret = config_parse_file(dump_defaults ? NULL : config_path,
flags, have_dump_filter ? &dump_filter : NULL,