From 14d9177ec87e420688db7a98eba6cff953eef54a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Dec 2016 09:38:06 +0000 Subject: [Minor] Add multipart flag --- src/libmime/content_type.c | 7 +++++++ src/libmime/content_type.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 43c7c61d1..0e2a89a77 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -90,6 +90,13 @@ rspamd_content_type_parse (const gchar *in, (rspamd_mempool_destruct_t)g_hash_table_unref, res->attrs); } + srch.begin = "multipart"; + srch.len = 9; + + if (rspamd_ftok_cmp (&res->type, &srch) == 0) { + res->flags |= RSPAMD_CONTENT_TYPE_MULTIPART; + } + /* Now do some hacks to work with broken content types */ if (res->subtype.len == 0) { res->flags |= RSPAMD_CONTENT_TYPE_BROKEN; diff --git a/src/libmime/content_type.h b/src/libmime/content_type.h index 2a60f5f01..f417ab8d6 100644 --- a/src/libmime/content_type.h +++ b/src/libmime/content_type.h @@ -23,6 +23,7 @@ enum rspamd_content_type_flags { RSPAMD_CONTENT_TYPE_VALID = 0, RSPAMD_CONTENT_TYPE_BROKEN = 1 << 0, + RSPAMD_CONTENT_TYPE_MULTIPART = 1 << 1, }; struct rspamd_content_type_param { -- cgit v1.2.3