dovecot-2.2: doveconf: Allow settings plugins to print comments ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 15 14:37:49 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/e9a05136fff2
changeset: 17958:e9a05136fff2
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 15 07:37:05 2014 -0700
description:
doveconf: Allow settings plugins to print comments to the output header.
If plugin contains <plugin name>_doveconf_comment string, it's written as
part of the doveconf output. The idea mainly being that the major plugins
(such as Pigeonhole) could print their version number there to avoid having
to ask for it separately.

diffstat:

 src/config/doveconf.c |  13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r e3b9cd19c33d -r e9a05136fff2 src/config/doveconf.c
--- a/src/config/doveconf.c	Tue Oct 14 16:57:13 2014 -0700
+++ b/src/config/doveconf.c	Wed Oct 15 07:37:05 2014 -0700
@@ -707,6 +707,7 @@
 	bool config_path_specified, expand_vars = FALSE, hide_key = FALSE;
 	bool parse_full_config = FALSE, simple_output = FALSE;
 	bool dump_defaults = FALSE, host_verify = FALSE;
+	bool print_plugin_comment = FALSE;
 
 	if (getenv("USE_SYSEXITS") != NULL) {
 		/* we're coming from (e.g.) LDA */
@@ -787,11 +788,23 @@
 		/* print the config file path before parsing it, so in case
 		   of errors it's still shown */
 		printf("# "DOVECOT_VERSION_FULL": %s\n", config_path);
+		print_plugin_comment = TRUE;
 		fflush(stdout);
 	}
 	master_service_init_finish(master_service);
 	config_parse_load_modules();
 
+	if (print_plugin_comment) {
+		struct module *m;
+
+		for (m = modules; m != NULL; m = m->next) {
+			const char **str = module_get_symbol_quiet(m,
+				t_strdup_printf("%s_doveconf_comment", m->name));
+			if (str != NULL)
+				printf("# %s\n", *str);
+		}
+	}
+
 	if ((ret = config_parse_file(dump_defaults ? NULL : config_path,
 				     expand_vars,
 				     parse_full_config ? NULL : wanted_modules,


More information about the dovecot-cvs mailing list