diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-09-04 16:33:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-09-04 16:33:12 +0100 |
commit | 55e758f714ced82a4a15b974f9154838938a2449 (patch) | |
tree | 53926a5e73d10af9b858e3276ae815adb7b30ee6 /src/plugins/lua/whitelist.lua | |
parent | 1b474dbb56f2c99bfd9cfc2c0adcdcd40ef69a5a (diff) | |
download | rspamd-55e758f714ced82a4a15b974f9154838938a2449.tar.gz rspamd-55e758f714ced82a4a15b974f9154838938a2449.zip |
[Minor] Use standard utility to get check_local/authed
Diffstat (limited to 'src/plugins/lua/whitelist.lua')
-rw-r--r-- | src/plugins/lua/whitelist.lua | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua index ab04577b0..24b154c94 100644 --- a/src/plugins/lua/whitelist.lua +++ b/src/plugins/lua/whitelist.lua @@ -322,24 +322,10 @@ local configure_whitelist_module = function() options[k] = v end - local function try_opts(where) - local ret = false - local test_opts = rspamd_config:get_all_opt(where) - if type(test_opts) == 'table' then - if type(test_opts.check_local) == 'boolean' then - options.check_local = test_opts.check_local - ret = true - end - if type(test_opts.check_authed) == 'boolean' then - options.check_authed = test_opts.check_authed - ret = true - end - end - - return ret - end - - if not try_opts(N) then try_opts('options') end + local auth_and_local_conf = lua_util.config_check_local_or_authed(rspamd_config, N, + false, false) + options.check_local = auth_and_local_conf[1] + options.check_authed = auth_and_local_conf[2] else rspamd_logger.infox(rspamd_config, 'Module is unconfigured') return |