diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-03 15:54:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-03 15:54:35 +0000 |
commit | 39adeb78973b782a8ce50b9e365f2ba639ceec0c (patch) | |
tree | 3295f252e0dfff00ec80653a4f6c68f1f29ea1ad /src | |
parent | 5244e863178e776d8af230e966da502920d1197b (diff) | |
download | rspamd-39adeb78973b782a8ce50b9e365f2ba639ceec0c.tar.gz rspamd-39adeb78973b782a8ce50b9e365f2ba639ceec0c.zip |
[Minor] Deal with DSN messages
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/content_type.c | 9 | ||||
-rw-r--r-- | src/libmime/content_type.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index ba4807e0f..28dadbc13 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -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; + } } } } diff --git a/src/libmime/content_type.h b/src/libmime/content_type.h index 69086fa7f..25283d365 100644 --- a/src/libmime/content_type.h +++ b/src/libmime/content_type.h @@ -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) |