From 329144bb71d9564bd20f548155a271e61366c836 Mon Sep 17 00:00:00 2001 From: Timo Sirainen <timo.sirainen@open-xchange.com> Date: Wed, 19 Apr 2023 14:05:06 +0300 Subject: [PATCH] lib-sieve-tool: Read settings only after handling command line parameters --- src/lib-sieve-tool/sieve-tool.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib-sieve-tool/sieve-tool.c b/src/lib-sieve-tool/sieve-tool.c index 1f5433db5..7ddc9937a 100644 --- a/src/lib-sieve-tool/sieve-tool.c +++ b/src/lib-sieve-tool/sieve-tool.c @@ -138,7 +138,6 @@ sieve_tool_init(const char *name, int *argc, char **argv[], MASTER_SERVICE_FLAG_STANDALONE | MASTER_SERVICE_FLAG_DONT_SEND_STATS | MASTER_SERVICE_FLAG_NO_INIT_DATASTACK_FRAME; - const char *error; if (no_config) service_flags |= MASTER_SERVICE_FLAG_NO_CONFIG_SETTINGS; @@ -151,9 +150,6 @@ sieve_tool_init(const char *name, int *argc, char **argv[], tool->no_config = no_config; i_array_init(&tool->sieve_plugins, 16); - - if (master_service_settings_read_simple(master_service, &error) < 0) - i_fatal("%s", error); return tool; } @@ -231,6 +227,9 @@ sieve_tool_init_finish(struct sieve_tool *tool, bool init_mailstore, const char *homedir = tool->homedir; const char *errstr; + if (master_service_settings_read_simple(master_service, &errstr) < 0) + i_fatal("%s", errstr); + master_service_init_finish(master_service); if (username == NULL) { -- GitLab