summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/greylist.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-12 17:27:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-12 17:27:13 +0100
commit5ccaf0c78a1b8ebcb75956941dcd648cf5614fe9 (patch)
tree846737c9d30a0a199dfe32f5963ea1e2f5330f3d /src/plugins/lua/greylist.lua
parent8e2facd1aaeaca370750185ba4b627e76140c02d (diff)
downloadrspamd-5ccaf0c78a1b8ebcb75956941dcd648cf5614fe9.tar.gz
rspamd-5ccaf0c78a1b8ebcb75956941dcd648cf5614fe9.zip
[Minor] Fix plugins to work with empty tasksmime-rework
Diffstat (limited to 'src/plugins/lua/greylist.lua')
-rw-r--r--src/plugins/lua/greylist.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua
index f39f197f5..796623b7f 100644
--- a/src/plugins/lua/greylist.lua
+++ b/src/plugins/lua/greylist.lua
@@ -63,6 +63,7 @@ local settings = {
local rspamd_logger = require "rspamd_logger"
local rspamd_util = require "rspamd_util"
+local lua_redis = require "lua_redis"
local fun = require "fun"
local hash = require "rspamd_cryptobox_hash"
local rspamd_lua_utils = require "lua_util"
@@ -258,13 +259,13 @@ local function greylist_check(task)
end
end
- local ret = rspamd_redis_make_request(task,
- redis_params, -- connect params
- hash_key, -- hash key
- false, -- is write
- redis_get_cb, --callback
- 'MGET', -- command
- {body_key, meta_key} -- arguments
+ local ret = lua_redis.redis_make_request(task,
+ redis_params, -- connect params
+ hash_key, -- hash key
+ false, -- is write
+ redis_get_cb, --callback
+ 'MGET', -- command
+ {body_key, meta_key} -- arguments
)
if not ret then
rspamd_logger.errx(task, 'cannot make redis request to check results')
@@ -373,7 +374,7 @@ local function greylist_set(task)
if not settings.check_local and is_rspamc then return end
- ret,conn,upstream = rspamd_redis_make_request(task,
+ ret,conn,upstream = lua_redis.make_request(task,
redis_params, -- connect params
hash_key, -- hash key
true, -- is write
@@ -396,7 +397,7 @@ local function greylist_set(task)
rspamd_logger.infox(task, 'greylisted until "%s", new record', end_time)
greylist_message(task, end_time, 'new record')
-- Create new record
- ret,conn,upstream = rspamd_redis_make_request(task,
+ ret,conn,upstream = lua_redis.redis_make_request(task,
redis_params, -- connect params
hash_key, -- hash key
true, -- is write
@@ -458,7 +459,7 @@ if opts then
whitelist_domains_map = lua_map.rspamd_map_add(N, 'whitelist_domains_url',
'map', 'Greylist whitelist domains map')
- redis_params = rspamd_parse_redis_server(N)
+ redis_params = lua_redis.parse_redis_server(N)
if not redis_params then
rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
rspamd_lua_utils.disable_module(N, "redis")
@@ -468,14 +469,12 @@ if opts then
type = 'postfilter',
callback = greylist_set,
priority = 6,
- flags = 'empty',
})
rspamd_config:register_symbol({
name = 'GREYLIST_CHECK',
type = 'prefilter',
callback = greylist_check,
priority = 6,
- flags = 'empty',
})
end
end