]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Multimap: email:domain:tld filter
authorAndrew Lewis <nerf@judo.za.org>
Tue, 16 May 2017 12:12:02 +0000 (14:12 +0200)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 May 2017 11:27:21 +0000 (12:27 +0100)
src/plugins/lua/multimap.lua

index f5f5edaca1d1654743f4345c7529acfb9f71db81..216018dc573fd44f8ddb3b39503038a7e60e11be 100644 (file)
@@ -223,6 +223,11 @@ local function apply_addr_filter(task, filter, input, rule)
     if addr and addr[1] then
       return addr[1]['domain']
     end
+  elseif filter == 'email:domain:tld' then
+    local addr = util.parse_mail_address(input, task:get_mempool())
+    if addr and addr[1] then
+      return util.get_tld(addr[1]['domain'])
+    end
   elseif filter == 'email:name' then
     local addr = util.parse_mail_address(input, task:get_mempool())
     if addr and addr[1] then