From 4c9f6b21186be5c87785d5f6c91fb26cb8300b5b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 2 Oct 2018 12:55:55 +0100 Subject: [Minor] Unify check_auth/check_local options --- src/plugins/spf.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/plugins/spf.c') diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 5ec5bfcfc..46160878f 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -206,15 +206,26 @@ spf_module_config (struct rspamd_config *cfg) spf_module_ctx->whitelist_ip = NULL; - if ((value = - rspamd_config_get_module_opt (cfg, "options", "check_local")) != NULL) { + value = rspamd_config_get_module_opt (cfg, "spf", "check_local"); + + if (value == NULL) { + rspamd_config_get_module_opt (cfg, "options", "check_local"); + } + + if (value != NULL) { spf_module_ctx->check_local = ucl_obj_toboolean (value); } else { spf_module_ctx->check_local = FALSE; } - if ((value = - rspamd_config_get_module_opt (cfg, "options", "check_authed")) != NULL) { + + value = rspamd_config_get_module_opt (cfg, "spf", "check_authed"); + + if (value == NULL) { + rspamd_config_get_module_opt (cfg, "options", "check_authed"); + } + + if (value != NULL) { spf_module_ctx->check_authed = ucl_obj_toboolean (value); } else { -- cgit v1.2.3