From 4daa55f0752193c17aa29b8e79a31028c4eaaac3 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Sat, 5 Aug 2017 11:09:03 +0300 Subject: [PATCH] [Feature] Ratelimit: allow full addresses in whitelisted_rcpts --- src/plugins/lua/ratelimit.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index afa9aba75..52df88ed0 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -481,7 +481,9 @@ local function rate_test_set(task, func) local rcpts = task:get_recipients() local rcpts_user = {} if rcpts then - fun.each(function(r) table.insert(rcpts_user, r['user']) end, rcpts) + fun.each(function(r) + fun.each(function(type) table.insert(rcpts_user, r[type]) end, {'user', 'addr'}) + end, rcpts) if fun.any( function(r) if fun.any(function(w) return r == w end, whitelisted_rcpts) then return true end -- 2.39.5