end
local function check_av_cache(task, rule, fn)
- local function redis_av_cb(task, err, data)
+ local function redis_av_cb(err, data)
if data and type(data) == 'string' then
-- Cached
if data ~= 'OK' then
local function save_av_cache(task, rule, to_save)
local key = task:get_digest()
- local function redis_set_cb(task, err, data)
+ local function redis_set_cb(err, data)
-- Do nothing
if err then
rspamd_logger.errx(task, 'failed to save virus cache for %s -> "%s": %s',
if redis_params then
local redis_key = options.key_prefix .. ip:to_string()
local ret,conn,upstream
- local function redis_asn_set_cb(task, err, data)
+ local function redis_asn_set_cb(err, data)
if not err then
upstream:ok()
else
local function asn_check_cache(ip, continuation_func)
local key = options.key_prefix .. ip:to_string()
- local function redis_asn_get_cb(task, err, data)
+ local function redis_asn_get_cb(err, data)
if err or not data or type(data[1]) ~= 'string' then
continuation_func(ip)
else
asn_set(data[1], data[2], data[3])
-- Refresh key
- local function redis_asn_expire_cb(task, err, data)
+ local function redis_asn_expire_cb(err, data)
end
local ret,_,_ = rspamd_redis_make_request(task,
return maybe_force_action('na')
end
- local function dmarc_report_cb(task, err, data)
+ local function dmarc_report_cb(err, data)
if not err then
rspamd_logger.infox(task, '<%1> dmarc report saved for %2',
task:get_message_id(), from[1]['domain'])
local function maybe_load_fann(task, continue_cb, call_if_fail)
local function load_fann()
- local function redis_fann_load_cb(task, err, data)
+ local function redis_fann_load_cb(err, data)
if not err and type(data) == 'table' and type(data[2]) == 'string' then
local version = tonumber(data[1])
local err,ann_data = rspamd_util.zstd_decompress(data[2])
end
local function check_fann()
- local function redis_fann_check_cb(task, err, data)
+ local function redis_fann_check_cb(err, data)
if not err and type(data) == 'string' then
local version = tonumber(data)
end
local function save_fann(task, is_spam)
- local function redis_fann_save_cb(task, err, data)
+ local function redis_fann_save_cb(err, data)
if err then
rspamd_logger.errx(task, "cannot save neural net to redis: %s", err)
end
local hash_key = body_key .. meta_key
local upstream
- local function redis_set_cb(task, err, data)
+ local function redis_set_cb(err, data)
if not err then
upstream:ok()
else
end
end
- local function redis_get_cb(task, err, data)
+ local function redis_get_cb(err, data)
local ret_body = false
local greylisted_body = false
local ret_meta = false
local upstream, ret, conn
local hash_key = body_key .. meta_key
- local function redis_set_cb(task, err, data)
+ local function redis_set_cb(err, data)
if not err then
upstream:ok()
else
return old_score + score, new_total
end
- local score_set_cb = function(task, err, data)
+ local score_set_cb = function(err, data)
if err then
rspamd_logger.infox(task, 'got error while IP score changing: %1', err)
end
local ip_score_check = function(task)
local asn, country, ipnet = ip_score_get_task_vars(task)
- local ip_score_redis_cb = function(task, err, data)
+ local ip_score_redis_cb = function(err, data)
local function calculate_score(score)
local parts = asn_re:split(score)
local rep = tonumber(parts[1])
return false
end
- local function redis_map_cb(task, err, data)
+ local function redis_map_cb(err, data)
if not err and type(data) ~= 'userdata' then
callback(data)
end
if all(function(k, elt) return elt.checked end, mxes) then
-- Save cache
local key = settings.key_prefix .. mx_domain
- local function redis_cache_cb(task, err, data)
+ local function redis_cache_cb(err, data)
if err ~= nil then
rspamd_logger.errx(task, 'redis_cache_cb received error: %1', err)
return
forced = true
})
else
- local function redis_cache_get_cb(task, err, data)
+ local function redis_cache_get_cb(err, data)
if err or type(data) ~= 'string' then
local r = task:get_resolver()
r:resolve('mx', {
local key = fun.foldl(function(acc, k) return acc .. k[2] end, '', args)
local ret,upstream
--- Called when value is got from server
- local function rate_get_cb(task, err, data)
+ local function rate_get_cb(err, data)
if err then
rspamd_logger.infox(task, 'got error while getting limit: %1', err)
upstream:fail()
local key = fun.foldl(function(acc, k) return acc .. k[2] end, '', args)
local ret, upstream
- local function rate_set_cb(task, err, data)
+ local function rate_set_cb(err, data)
if not err then
upstream:ok()
else
err, upstream:get_addr())
end
end
- local function rate_get_cb(task, err, data)
+ local function rate_get_cb(err, data)
if err then
rspamd_logger.infox(task, 'got error while setting limit: %1', err)
upstream:fail()
end
local function replies_check(task)
- local function redis_get_cb(task, err, data)
+ local function redis_get_cb(err, data)
if err ~= nil then
rspamd_logger.errx('redis_get_cb received error: %1', err)
return
end
local function replies_set(task)
- local function redis_set_cb(task, err, data)
+ local function redis_set_cb(err, data)
if err ~=nil then
rspamd_logger.errx('redis_set_cb received error: %1', err)
end
return function(task)
local key = handler(task)
- local function redis_settings_cb(task, err, data)
+ local function redis_settings_cb(err, data)
if not err and type(data) == 'string' then
local ucl = require "ucl"
local parser = ucl.parser()