From 683bdf2c840e108d6a0b36971e02efb812691da9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 12 Jun 2017 10:55:22 +0100 Subject: [PATCH] [Minor] Add workaround for ISO-2022-JP encoding Issue: #1669 --- src/libmime/mime_headers.c | 14 ++++++++++++-- 1 file 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; + } } } -- 2.39.5