aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2017-08-05 10:51:07 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2017-08-05 11:08:32 +0300
commit2d4a07cf3b36bd5e6c66e8d3847d387352f136a7 (patch)
tree2a3eca18d361c9e8234cd2a31f7276cd61c8a480
parentdd1ef3fa2b6585a39128ab7fc719f241c7334bb4 (diff)
downloadrspamd-2d4a07cf3b36bd5e6c66e8d3847d387352f136a7.tar.gz
rspamd-2d4a07cf3b36bd5e6c66e8d3847d387352f136a7.zip
[Fix] Ratelimit: fix whitelisted_rcpts matching
-rw-r--r--src/plugins/lua/ratelimit.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index c1d98d4aa..afa9aba75 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -482,8 +482,10 @@ local function rate_test_set(task, func)
local rcpts_user = {}
if rcpts then
fun.each(function(r) table.insert(rcpts_user, r['user']) end, rcpts)
- if fun.any(function(r)
- fun.any(function(w) return r == w end, whitelisted_rcpts) end,
+ if fun.any(
+ function(r)
+ if fun.any(function(w) return r == w end, whitelisted_rcpts) then return true end
+ end,
rcpts_user) then
rspamd_logger.infox(task, 'skip ratelimit for whitelisted recipient')