aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libmime/mime_encoding.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c
index 6790cd8e6..ca916c015 100644
--- a/src/libmime/mime_encoding.c
+++ b/src/libmime/mime_encoding.c
@@ -104,7 +104,9 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool)
ret = rspamd_mempool_ftokdup (pool, in);
rspamd_charset_normalize (ret);
- if (memchr (in->begin, '-', in->len) != NULL) {
+ if ((in->len > 3 && rspamd_lc_cmp (in->begin, "cp-", 3) == 0) ||
+ (in->len > 4 && (rspamd_lc_cmp (in->begin, "ibm-", 4) == 0 ||
+ rspamd_lc_cmp (in->begin, "iso-", 4) == 0) )) {
/* Try to remove '-' chars from encoding: e.g. CP-100 to CP100 */
h = ret;
t = ret;