if (*info != '\0')
printf("# %s\n", info);
printf("# Hostname: %s\n", my_hostdomain());
- if (config_parsed_get_version(config, &version))
+ if (config_parsed_get_version(config, &version)) {
+ unsigned int count = old_settings_default_changes_count(version);
+ if (count > 0) {
+ printf("# %u default setting changes since version %s\n",
+ count, version);
+ }
printf("dovecot_config_version = %s\n", version);
+ }
if (!config_path_specified)
check_wrong_config(config_path);
if (scope == CONFIG_DUMP_SCOPE_ALL_WITHOUT_HIDDEN)
}
return FALSE;
}
+
+unsigned int
+old_settings_default_changes_count(const char *dovecot_config_version)
+{
+ struct settings_history *history = settings_history_get();
+ const struct setting_history_default *def;
+ unsigned int count = 0;
+
+ array_foreach(&history->defaults, def) {
+ if (version_cmp(def->version, dovecot_config_version) <= 0)
+ break;
+ count++;
+ }
+ return count;
+}
bool old_settings_default(const char *dovecot_config_version,
const char *key, const char *key_with_path,
const char **old_default_r);
+unsigned int
+old_settings_default_changes_count(const char *dovecot_config_version);
#endif