]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Phishing: strict_domains
authorAndrew Lewis <nerf@judo.za.org>
Fri, 26 May 2017 11:19:05 +0000 (13:19 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sun, 28 May 2017 14:00:56 +0000 (16:00 +0200)
src/plugins/lua/phishing.lua

index 74909e9da1582cda3c6abc81ff4ab7de71cdc958..466d02b1698ed316ace19285eee8181d075622f0 100644 (file)
@@ -178,12 +178,14 @@ local function phishing_cb(task)
           rspamd_logger.debugm(N, task, "distance: %1 -> %2: %3", tld, ptld, dist)
         end
 
-        local function found_in_map(map)
+        local function found_in_map(map, furl, sweight)
+          if not furl then furl = url end
+          if not sweight then sweight = weight end
           if #map > 0 then
             for _,rule in ipairs(map) do
-                for _,dn in ipairs({url:get_tld(), url:get_host()}) do
+                for _,dn in ipairs({furl:get_tld(), furl:get_host()}) do
                   if rule['map']:get_key(dn) then
-                    task:insert_result(rule['symbol'], weight, ptld .. '->' .. dn)
+                    task:insert_result(rule['symbol'], sweight, ptld .. '->' .. dn)
                     return true
                   end
                 end