summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/reputation.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-12 19:44:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-12 19:44:48 +0100
commita5c9b5f6021df9c560a81df2cbafd6bb3239c0a4 (patch)
treee0163fe68f48eeda8dd14c9fa0df5f6cdb300d92 /src/plugins/lua/reputation.lua
parentc7cedc9dfb094bf5604729478c5469955b10f051 (diff)
downloadrspamd-a5c9b5f6021df9c560a81df2cbafd6bb3239c0a4.tar.gz
rspamd-a5c9b5f6021df9c560a81df2cbafd6bb3239c0a4.zip
[Minor] Use config field
Diffstat (limited to 'src/plugins/lua/reputation.lua')
-rw-r--r--src/plugins/lua/reputation.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua
index e51ed3299..4389d72b5 100644
--- a/src/plugins/lua/reputation.lua
+++ b/src/plugins/lua/reputation.lua
@@ -291,18 +291,18 @@ local backends = {
}
local function is_rule_applicable(task, rule)
- if rule.outbound then
+ if rule.config.outbound then
if not (task:get_user() or (ip and ip:is_local())) then
return false
end
- elseif rule.inbound then
+ elseif rule.config.inbound then
if task:get_user() or (ip and ip:is_local()) then
return false
end
end
- if rule.whitelisted_ip_map then
- if rule.whitelisted_ip_map:get_key(task:get_from_ip()) then
+ if rule.config.whitelisted_ip_map then
+ if rule.config.whitelisted_ip_map:get_key(task:get_from_ip()) then
return false
end
end
@@ -390,7 +390,8 @@ local function parse_rule(name, tbl)
-- Allow config override
local rule = {
selector = deepcopy(selector),
- backend = deepcopy(backend)
+ backend = deepcopy(backend),
+ config = {}
}
-- Override default config params
@@ -399,8 +400,8 @@ local function parse_rule(name, tbl)
-- Generic options
override_defaults(rule.config, tbl)
- if rule.whitelisted_ip then
- rule.whitelisted_ip_map = lua_maps.rspamd_map_add_from_ucl(rule.whitelisted_ip,
+ if rule.config.whitelisted_ip then
+ rule.config.whitelisted_ip_map = lua_maps.rspamd_map_add_from_ucl(rule.whitelisted_ip,
'radix',
'Reputation whiteliist for ' .. name)
end