]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add workaround for ISO-2022-JP encoding
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Jun 2017 09:55:22 +0000 (10:55 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Jun 2017 09:55:22 +0000 (10:55 +0100)
Issue: #1669

src/libmime/mime_headers.c

index bb9284f6a185181afda7be1067ba5ac1fa6b4eb3..593f13b1102ed5a8d81655b996a28b722fc8a919 100644 (file)
@@ -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;
+                       }
                }
        }