(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->subtype.len = 11;
}
}
+
+ srch.begin = "multipart";
+ srch.len = 9;
+
+ if (rspamd_ftok_cmp (&res->type, &srch) == 0) {
+ res->flags |= RSPAMD_CONTENT_TYPE_MULTIPART;
+ }
+ else {
+ srch.begin = "text";
+ srch.len = 4;
+
+ if (rspamd_ftok_cmp (&res->type, &srch) == 0) {
+ res->flags |= RSPAMD_CONTENT_TYPE_TEXT;
+ }
+ else {
+ srch.begin = "message";
+ srch.len = 7;
+
+ if (rspamd_ftok_cmp (&res->type, &srch) == 0) {
+ res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
+ }
+ }
+ }
}
else {
msg_warn_pool ("cannot parse content type: %*s", (gint)len, val.lc_data);
RSPAMD_CONTENT_TYPE_VALID = 0,
RSPAMD_CONTENT_TYPE_BROKEN = 1 << 0,
RSPAMD_CONTENT_TYPE_MULTIPART = 1 << 1,
+ RSPAMD_CONTENT_TYPE_TEXT = 1 << 2,
+ RSPAMD_CONTENT_TYPE_MESSAGE = 1 << 3,
};
struct rspamd_content_type_param {