]> source.dussan.org Git - rspamd.git/commitdiff
Rules updates 1562/head
authorSteve Freegard <steve@stevefreegard.com>
Tue, 28 Mar 2017 22:46:35 +0000 (23:46 +0100)
committerSteve Freegard <steve@stevefreegard.com>
Wed, 29 Mar 2017 14:08:00 +0000 (15:08 +0100)
rules/headers_checks.lua
rules/misc.lua
rules/regexp/misc.lua

index a4e202f5e651f36af6c30c269b60fdaf8c19badd..1ff27ce2f900d0ada3f87121080fea60864b1d1e 100644 (file)
@@ -881,3 +881,23 @@ rspamd_config:register_symbol{
   type = 'virtual',
   description = 'Some of the recipients match the envelope',
 }
+
+rspamd_config.CTYPE_MISSING_DISPOSITION = {
+  callback = function(task)
+    local parts = task:get_parts()
+    if (not parts) or (parts and #parts < 1) then return false end
+    for _,p in ipairs(parts) do
+      local ct = p:get_header('Content-Type')
+      if (ct and ct:lower():match('^application/octet%-stream') ~= nil) then
+        local cd = p:get_header('Content-Disposition')
+        if (not cd) or (cd and cd:lower():find('^attachment') == nil) then
+          return true
+        end
+      end
+    end
+    return false
+  end,
+  description = 'Binary content-type not specified as an attachment',
+  score = 4.0,
+  group = 'header'
+}
index 07af50c125e0edaa66b76c7a8e6cb34d1f88c7ae..0d83fa02ac394e05c7c7c7c002f4c1ad91bdc0ab 100644 (file)
@@ -204,6 +204,8 @@ local check_rcvd = rspamd_config:register_symbol{
       local rcvd = rcvds[1]
       if rcvd.flags and rcvd.flags['ssl'] then
         task:insert_result('RCVD_TLS_LAST', 1.0)
+      else
+        task:insert_result('RCVD_NO_TLS_LAST', 1.0)
       end
     end
 
@@ -235,6 +237,15 @@ rspamd_config:register_symbol{
   group = 'encryption'
 }
 
+rspamd_config:register_symbol{
+  type = 'virtual',
+  parent = check_rcvd,
+  name = 'RCVD_NO_TLS_LAST',
+  description = 'Last hop did not use encrypted transports',
+  score = 0.0,
+  group = 'encryption'
+}
+
 rspamd_config:register_symbol{
   type = 'virtual',
   parent = check_rcvd,
index 2da59ef7f1d02f38545532544312bb2b2b037c17..1adfe98fdb40ce29acb2f22a70f8b1607cfaa110 100644 (file)
@@ -19,7 +19,7 @@ local reconf = config['regexp']
 
 reconf['HTML_META_REFRESH_URL'] = {
   -- Requires options { check_attachements = true; }
-  re = '/<meta\\s+http-equiv="refresh"\\s+content="\\d+;url=/{sa_raw_body}i',
+  re = '/<meta\\s+http-equiv="refresh"\\s+content="\\d+\\s*;\\s*url=/{sa_raw_body}i',
   description = "Has HTML Meta refresh URL",
   score = 5.0,
   group = 'HTML'