diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:55:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:55:22 +0100 |
commit | 683bdf2c840e108d6a0b36971e02efb812691da9 (patch) | |
tree | 926d6322dfe9daf5bbadcac61ace398b3dda3178 /src/libmime/mime_headers.c | |
parent | 13659ea7caeb1410022035e34fdd8023359c3e54 (diff) | |
download | rspamd-683bdf2c840e108d6a0b36971e02efb812691da9.tar.gz rspamd-683bdf2c840e108d6a0b36971e02efb812691da9.zip |
[Minor] Add workaround for ISO-2022-JP encoding
Issue: #1669
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r-- | src/libmime/mime_headers.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index bb9284f6a..593f13b11 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -471,8 +471,18 @@ rspamd_mime_header_maybe_save_token (rspamd_mempool_t *pool, GString *out, if (old_charset->len > 0) { if (rspamd_ftok_casecmp (new_charset, old_charset) == 0) { - /* We can concatenate buffers, just return */ - return; + rspamd_ftok_t srch; + + /* + * Special case for iso-2022-jp: + * https://github.com/vstakhov/rspamd/issues/1669 + */ + RSPAMD_FTOK_ASSIGN (&srch, "iso-2022-jp"); + + if (rspamd_ftok_casecmp (new_charset, &srch) != 0) { + /* We can concatenate buffers, just return */ + return; + } } } |