diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-10 20:18:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-10 20:18:44 +0100 |
commit | 064a12b377b10d7408b4fcf9ec7861426fb85129 (patch) | |
tree | f843d9882061533e215bb11d360ac2f91be89c93 /src/libmime/content_type.c | |
parent | 6729b60066a4dcf9a38e3e766d829b9932ec5d29 (diff) | |
download | rspamd-064a12b377b10d7408b4fcf9ec7861426fb85129.tar.gz rspamd-064a12b377b10d7408b4fcf9ec7861426fb85129.zip |
[Minor] Try to deal with broken CD headers
Diffstat (limited to 'src/libmime/content_type.c')
-rw-r--r-- | src/libmime/content_type.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 88102ad2c..40f0fd351 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -832,6 +832,12 @@ rspamd_content_disposition_parse (const gchar *in, struct rspamd_content_disposition *res = NULL, val; if (rspamd_content_disposition_parser (in, len, &val, pool)) { + + if (val.type == RSPAMD_CT_UNKNOWN) { + /* 'Fix' type to attachment as MUA does */ + val.type = RSPAMD_CT_ATTACHMENT; + } + res = rspamd_mempool_alloc (pool, sizeof (val)); memcpy (res, &val, sizeof (val)); res->lc_data = rspamd_mempool_alloc (pool, len + 1); |