commit 69f9feb: [Minor] Multimap use limits when parsing email addresses

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jun 11 16:42:09 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-06-11 17:36:50 +0100
URL: https://github.com/rspamd/rspamd/commit/69f9feb219ec6a7219d88016fb054b5da929bf7b

[Minor] Multimap use limits when parsing email addresses

---
 src/plugins/lua/multimap.lua | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index 356b8f7c9..c9b68ba05 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -233,27 +233,27 @@ end
 
 local function apply_addr_filter(task, filter, input, rule)
   if filter == 'email:addr' or filter == 'email' then
-    local addr = util.parse_mail_address(input, task:get_mempool())
+    local addr = util.parse_mail_address(input, task:get_mempool(), 1024)
     if addr and addr[1] then
       return fun.totable(fun.map(function(a) return a.addr end, addr))
     end
   elseif filter == 'email:user' then
-    local addr = util.parse_mail_address(input, task:get_mempool())
+    local addr = util.parse_mail_address(input, task:get_mempool(), 1024)
     if addr and addr[1] then
       return fun.totable(fun.map(function(a) return a.user end, addr))
     end
   elseif filter == 'email:domain' then
-    local addr = util.parse_mail_address(input, task:get_mempool())
+    local addr = util.parse_mail_address(input, task:get_mempool(, 1024)
     if addr and addr[1] then
       return fun.totable(fun.map(function(a) return a.domain end, addr))
     end
   elseif filter == 'email:domain:tld' then
-    local addr = util.parse_mail_address(input, task:get_mempool())
+    local addr = util.parse_mail_address(input, task:get_mempool(), 1024)
     if addr and addr[1] then
       return fun.totable(fun.map(function(a) return util.get_tld(a.domain) end, addr))
     end
   elseif filter == 'email:name' then
-    local addr = util.parse_mail_address(input, task:get_mempool())
+    local addr = util.parse_mail_address(input, task:get_mempool(), 1024)
     if addr and addr[1] then
       return fun.totable(fun.map(function(a) return a.name end, addr))
     end
@@ -473,7 +473,7 @@ local function multimap_callback(task, rule)
       ret = r.hash:get_key(value)
     end
 
-    lua_util.debugm(N, task, 'found return "%s" for multimap %s', ret, 
+    lua_util.debugm(N, task, 'found return "%s" for multimap %s', ret,
     rule.symbol)
 
     if ret then


More information about the Commits mailing list