diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-08-05 10:51:07 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-08-05 11:08:32 +0300 |
commit | 2d4a07cf3b36bd5e6c66e8d3847d387352f136a7 (patch) | |
tree | 2a3eca18d361c9e8234cd2a31f7276cd61c8a480 | |
parent | dd1ef3fa2b6585a39128ab7fc719f241c7334bb4 (diff) | |
download | rspamd-2d4a07cf3b36bd5e6c66e8d3847d387352f136a7.tar.gz rspamd-2d4a07cf3b36bd5e6c66e8d3847d387352f136a7.zip |
[Fix] Ratelimit: fix whitelisted_rcpts matching
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 6 |
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') |