aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-11-07 17:19:49 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-11-07 17:19:49 +0200
commitd7e15fe4438b87e1b180213d0d30adfa44ec1621 (patch)
tree568568016052f196e9f4a016515145937a386f18 /src/plugins
parenteb5092344780be868a753dedfdc00e296f0262ad (diff)
downloadrspamd-d7e15fe4438b87e1b180213d0d30adfa44ec1621.tar.gz
rspamd-d7e15fe4438b87e1b180213d0d30adfa44ec1621.zip
[Minor] Remove handful more globals
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/hfilter.lua5
-rw-r--r--src/plugins/lua/ratelimit.lua7
-rw-r--r--src/plugins/lua/trie.lua2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/lua/hfilter.lua b/src/plugins/lua/hfilter.lua
index 61595c253..ea4830c67 100644
--- a/src/plugins/lua/hfilter.lua
+++ b/src/plugins/lua/hfilter.lua
@@ -299,7 +299,7 @@ local function hfilter(task)
--No more checks for auth user or local network
local rip = task:get_from_ip()
- if ((not check_user and task:get_user()) or
+ if ((not check_authed and task:get_user()) or
(not check_local and rip and rip:is_local())) then
return false
end
@@ -312,8 +312,9 @@ local function hfilter(task)
-- Check's HELO
local weight_helo = 0
+ local helo
if config['helo_enabled'] then
- local helo = task:get_helo()
+ helo = task:get_helo()
if helo then
if helo ~= rspamc_local_helo then
helo = string.gsub(helo, '[%[%]]', '')
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index 001f3caa1..d6a2e7987 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -376,7 +376,7 @@ local function set_limits(task, args)
conn:add_cmd('setex', v)
end, fun.drop_n(1, values))
else
- rspamd_logger.infox(task, 'got error while connecting to redis: %1', addr)
+ rspamd_logger.infox(task, 'got error while connecting to redis: %1', upstream:get_addr())
upstream:fail()
end
end
@@ -482,8 +482,8 @@ local function parse_limit(str)
local key_keywords = rspamd_str_split(params[1], '_')
for _, k in ipairs(key_keywords) do
- if (custom_keywords[v] and type(custom_keywords[v]['get_value']) == 'function') or
- (keywords[v] and type(keywords[v]['get_value']) == 'function') then
+ if (custom_keywords[k] and type(custom_keywords[k]['get_value']) == 'function') or
+ (keywords[k] and type(keywords[k]['get_value']) == 'function') then
set_limit(settings[params[1]], params[2], params[3])
else
rspamd_logger.errx(rspamd_config, 'invalid limit type: ' .. params[1])
@@ -588,6 +588,7 @@ if opts then
priority = 10,
})
else
+ local symbol
if not ratelimit_symbol then
symbol = 'RATELIMIT_CHECK'
else
diff --git a/src/plugins/lua/trie.lua b/src/plugins/lua/trie.lua
index ebc4e2a7e..a0ac862a5 100644
--- a/src/plugins/lua/trie.lua
+++ b/src/plugins/lua/trie.lua
@@ -95,7 +95,7 @@ local function process_single_pattern(pat, symbol, cf)
end
local function process_trie_file(symbol, cf)
- file = io.open(cf['file'])
+ local file = io.open(cf['file'])
if not file then
rspamd_logger.errx(rspamd_config, 'Cannot open trie file %1', cf['file'])