]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Deal with DSN messages
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Mar 2017 15:54:35 +0000 (15:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Mar 2017 15:54:35 +0000 (15:54 +0000)
rules/misc.lua
src/libmime/content_type.c
src/libmime/content_type.h

index de088ae4c31f23253883665358ef924787ab7129..6b2ed8ce651dc8e22893bc84fa672d1dd67149bb 100644 (file)
@@ -188,7 +188,7 @@ rspamd_config.BROKEN_CONTENT_TYPE = {
     return fun.any(function(p) return p:is_broken() end,
       task:get_parts())
   end,
-  score = 3.0,
+  score = 1.5,
   group = 'header',
   description = 'Message has part with broken content type'
 }
index ba4807e0fb6902e6a53039799698c803ad9a7626..28dadbc135404394741998d530c679b6807d3468 100644 (file)
@@ -144,7 +144,14 @@ rspamd_content_type_parse (const gchar *in,
                                RSPAMD_FTOK_ASSIGN (&srch, "message");
 
                                if (rspamd_ftok_cmp (&res->type, &srch) == 0) {
-                                       res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
+                                       RSPAMD_FTOK_ASSIGN (&srch, "delivery-status");
+
+                                       if (rspamd_ftok_cmp (&res->subtype, &srch) == 0) {
+                                               res->flags |= RSPAMD_CONTENT_TYPE_TEXT|RSPAMD_CONTENT_TYPE_DSN;
+                                       }
+                                       else {
+                                               res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
+                                       }
                                }
                        }
                }
index 69086fa7fab388bdb7c468023676beda00cc5cb1..25283d3653b42574eb3435cdf83c257520843abf 100644 (file)
@@ -26,6 +26,7 @@ enum rspamd_content_type_flags {
        RSPAMD_CONTENT_TYPE_MULTIPART = 1 << 1,
        RSPAMD_CONTENT_TYPE_TEXT = 1 << 2,
        RSPAMD_CONTENT_TYPE_MESSAGE = 1 << 3,
+       RSPAMD_CONTENT_TYPE_DSN = 1 << 4,
 };
 
 #define IS_CT_MULTIPART(ct) ((ct)->flags & RSPAMD_CONTENT_TYPE_MULTIPART)