]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Attach domain part to `R_SUSPICIOUS_URL` 592/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 15 Apr 2016 07:50:37 +0000 (10:50 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 15 Apr 2016 07:50:37 +0000 (10:50 +0300)
conf/metrics.conf
rules/misc.lua

index 96304725bb7d6cd69f506a5099751363d506bbdb..634a6f69885b3e4c8b230e533be2a10897a6730c 100644 (file)
@@ -1002,6 +1002,13 @@ metric {
             one_shot = true;
         }
     }
+    group "url" {
+        symbol "R_SUSPICIOUS_URL" {
+            weight = 6.0;
+            description = "Obfusicated or suspicious URL has been found in a message";
+            one_shot = true;
+        }
+    }
 
     .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/metrics.conf"
     .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/metrics.conf"
index 87687720a32111b99eecd40bed2d156c4d325549..b3926e46b707c03204da6fdeeb601472d93b57cc 100644 (file)
@@ -83,24 +83,18 @@ rspamd_config.DATE_IN_PAST = function(task)
        return false
 end
 
-rspamd_config.R_SUSPICIOUS_URL = {
-  callback = function(task)
+rspamd_config.R_SUSPICIOUS_URL = function(task)
     local urls = task:get_urls()
 
     if urls then
       for i,u in ipairs(urls) do
         if u:is_obscured() then
-          return true
+          task:insert_result('R_SUSPICIOUS_URL', 1.0, u:get_host())
         end
       end
     end
     return false
-  end,
-  score = 6.0,
-  group = 'url',
-  one_shot = true,
-  description = 'Obfusicated or suspicious URL has been found in a message'
-}
+end
 
 rspamd_config.SUBJ_ALL_CAPS = {
   callback = function(task)