]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Relax CTYPE_MISSING_DISPOSITION rule for pgp encryption
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 Jan 2019 18:29:40 +0000 (18:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 Jan 2019 18:29:40 +0000 (18:29 +0000)
Issue: #2706
Closes: #2706
rules/headers_checks.lua

index 353690b56a89272b153904dd766a50c43022663c..359975dc1346e133e120e1bb6a7dcf937cce9d80 100644 (file)
@@ -958,6 +958,7 @@ rspamd_config:register_symbol{
   description = 'Some of the recipients match the envelope',
 }
 
+-- TODO: rewrite this rule, it should not touch headers directly
 rspamd_config.CTYPE_MISSING_DISPOSITION = {
   callback = function(task)
     local parts = task:get_parts()
@@ -972,6 +973,18 @@ rspamd_config.CTYPE_MISSING_DISPOSITION = {
           then
             return false
           end
+
+          local parent = p:get_parent()
+
+          if parent then
+            local t,st = parent:get_type()
+
+            if t == 'multipart' and st == 'encrypted' then
+              -- Special case
+              return false
+            end
+          end
+
           return true
         end
       end