From: Vsevolod Stakhov Date: Sat, 5 Aug 2017 20:22:14 +0000 (+0100) Subject: [Fix] Try harder to find rfc822 notifications X-Git-Tag: 1.7.0~763 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=76a11f2feb1be9d7f8940ab6a77be04a222ee81d;p=rspamd.git [Fix] Try harder to find rfc822 notifications Issue: #1731 Closes: #1731 --- diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 240e2fab5..f115bcb31 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -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; + } } } }