From e3e7e1bb8fe7369f27da0d2348d423d919c766b2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 13 Jul 2018 22:47:27 +0100 Subject: [PATCH] [Minor] Fix custom keywords initialisation --- src/plugins/lua/ratelimit.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 73f05a1cf..a84103ff9 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -613,22 +613,23 @@ if opts then 'Ratelimit whitelist user map') end + settings.custom_keywords = {} if opts['custom_keywords'] then - local ret, res_or_err = pcall(dofile(opts['custom_keywords'])) + local ret, res_or_err = pcall(loadfile(opts['custom_keywords'])) if ret then opts['custom_keywords'] = {} if type(res_or_err) == 'table' then for k,hdl in pairs(res_or_err) do - opts['custom_keywords'][k] = hdl + settings['custom_keywords'][k] = hdl end elseif type(res_or_err) == 'function' then - opts['custom_keywords']['custom'] = res_or_err + settings['custom_keywords']['custom'] = res_or_err end else rspamd_logger.errx(rspamd_config, 'cannot execute %s: %s', opts['custom_keywords'], res_or_err) - opts['custom_keywords'] = {} + settings['custom_keywords'] = {} end end -- 2.39.5