]> 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)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 16 May 2017 12:12:02 +0000 (14:12 +0200)
src/plugins/lua/multimap.lua

index 1db4b7967bc76cf7a3a7a0d2c269bd859abfe1af..0a1cf15b588a40bd55e2632540216e662e61a690 100644 (file)
@@ -227,6 +227,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