From: Vsevolod Stakhov Date: Mon, 12 Jun 2017 09:55:22 +0000 (+0100) Subject: [Minor] Add workaround for ISO-2022-JP encoding X-Git-Tag: 1.6.0~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=683bdf2c840e108d6a0b36971e02efb812691da9;p=rspamd.git [Minor] Add workaround for ISO-2022-JP encoding Issue: #1669 --- 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; + } } }