]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Try harder to find rfc822 notifications
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 5 Aug 2017 20:22:14 +0000 (21:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 5 Aug 2017 20:22:14 +0000 (21:22 +0100)
Issue: #1731
Closes: #1731
src/libmime/content_type.c

index 240e2fab503d518644959973f3c4d747c07d60fa..f115bcb313b5d43c72d52a1a106e1f8f7a4b5181 100644 (file)
@@ -427,7 +427,16 @@ rspamd_content_type_parse (const gchar *in,
                                                res->flags |= RSPAMD_CONTENT_TYPE_TEXT|RSPAMD_CONTENT_TYPE_DSN;
                                        }
                                        else {
-                                               res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
+                                               RSPAMD_FTOK_ASSIGN (&srch, "notification");
+
+                                               if (rspamd_substring_search_caseless (res->subtype.begin,
+                                                               res->subtype.len, srch.begin, srch.len) != -1) {
+                                                       res->flags |= RSPAMD_CONTENT_TYPE_TEXT|
+                                                                       RSPAMD_CONTENT_TYPE_DSN;
+                                               }
+                                               else {
+                                                       res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
+                                               }
                                        }
                                }
                        }