]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Ratelimit: allow full addresses in whitelisted_rcpts
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 5 Aug 2017 08:09:03 +0000 (11:09 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 5 Aug 2017 08:09:03 +0000 (11:09 +0300)
src/plugins/lua/ratelimit.lua

index afa9aba75b1b6f7d88a26b87d70e37ede7777580..52df88ed06d06b686563d4b8fda340b503419788 100644 (file)
@@ -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