diff options
-rw-r--r-- | src/libmime/content_type.c | 1 | ||||
-rw-r--r-- | src/libmime/content_type.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 934c12eab..e04f2bc15 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -83,6 +83,7 @@ rspamd_content_type_parse (const gchar *in, /* Now do some hacks to work with broken content types */ if (res->subtype.len == 0) { + res->flags |= RSPAMD_CONTENT_TYPE_BROKEN; srch.begin = "text"; srch.len = 4; diff --git a/src/libmime/content_type.h b/src/libmime/content_type.h index 7c129936d..f26e2f4a0 100644 --- a/src/libmime/content_type.h +++ b/src/libmime/content_type.h @@ -20,6 +20,11 @@ #include "libutil/fstring.h" #include "libutil/mem_pool.h" +enum rspamd_content_type_flags { + RSPAMD_CONTENT_TYPE_VALID = 0, + RSPAMD_CONTENT_TYPE_BROKEN = 1 << 0, +}; + struct rspamd_content_type_param { rspamd_ftok_t name; rspamd_ftok_t value; @@ -31,6 +36,7 @@ struct rspamd_content_type { rspamd_ftok_t type; rspamd_ftok_t subtype; rspamd_ftok_t charset; + enum rspamd_content_type_flags flags; GHashTable *attrs; /* Can be empty */ }; |