]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add multipart flag
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Dec 2016 09:38:06 +0000 (09:38 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Dec 2016 10:07:22 +0000 (10:07 +0000)
src/libmime/content_type.c
src/libmime/content_type.h

index 43c7c61d1ae524911877c64ca36f6b19fd0de9a2..0e2a89a77e729df92ae05dc4312dbab5aed57d8b 100644 (file)
@@ -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;
index 2a60f5f01d26a07751f07d86b73876e67444c658..f417ab8d6b57b546ed844868727870d82ac6d7fa 100644 (file)
@@ -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 {