diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-07 13:23:27 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-07 13:23:27 +0100 |
commit | 52b508ca0086d76a63229dc648c7bad421a5cd0c (patch) | |
tree | 13c9eb087b960d8f80a801aa5e25088a8852a0de /src | |
parent | 48d98e692130032fc2ec89b174c27820a1d5f9ac (diff) | |
download | rspamd-52b508ca0086d76a63229dc648c7bad421a5cd0c.tar.gz rspamd-52b508ca0086d76a63229dc648c7bad421a5cd0c.zip |
[Fix] Do not greylist messages if redis has failed somehow
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/greylist.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 6e068e1d5..81d4604a0 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -208,8 +208,9 @@ local function greylist_check(task) end if addr then - if not rspamd_redis.make_request(task, addr, redis_get_cb, 'MGET', - {body_key, meta_key}) then + local ret = rspamd_redis.make_request(task, addr, redis_get_cb, 'MGET', + {body_key, meta_key}) + if not ret then rspamd_logger.errx(task, 'cannot make redis request to check results') end end @@ -268,9 +269,16 @@ local function greylist_set(task) if grey_res then task:insert_result(settings['symbol'], 0.0, grey_res, 'meta') rspamd_logger.infox(task, 'greylisting delayed till "%s": meta', grey_res) + --[[ + -- We got some redis error, but we don't know what, so we just ignore it + -- for now else task:insert_result(settings['symbol'], 0.0, 'unknown') rspamd_logger.infox(task, 'greylisting delayed: unknown, internal error') + --]] + else + task:insert_result(settings['symbol'], 0.0, 'greylisted', 'redis fail') + return end end task:set_metric_action('default', 'soft reject') |