summaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_encoding.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-16 15:36:54 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-16 15:36:54 +0000
commite0fd3d254d0f026ec7571069ee7bca77bbd9f4f3 (patch)
tree1916265a3906aebfb8bb5b97bf54d693028d7e25 /src/libmime/mime_encoding.c
parent3c4fbc745b1f34ad505749f5110722d7a13f0cee (diff)
downloadrspamd-e0fd3d254d0f026ec7571069ee7bca77bbd9f4f3.tar.gz
rspamd-e0fd3d254d0f026ec7571069ee7bca77bbd9f4f3.zip
[Minor] Add methods to extract real charset from text parts
Diffstat (limited to 'src/libmime/mime_encoding.c')
-rw-r--r--src/libmime/mime_encoding.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c
index 8788403f3..c30cbe3e3 100644
--- a/src/libmime/mime_encoding.c
+++ b/src/libmime/mime_encoding.c
@@ -690,6 +690,7 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
}
checked = TRUE;
+ text_part->real_charset = charset;
}
else {
SET_PART_UTF (text_part);
@@ -697,6 +698,7 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
rspamd_mime_text_part_ucs_from_utf (task, text_part);
rspamd_mime_text_part_normalise (task, text_part);
rspamd_mime_text_part_maybe_renormalise (task, text_part);
+ text_part->real_charset = UTF8_CHARSET;
return;
}
@@ -710,6 +712,7 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
MIN (RSPAMD_CHARSET_MAX_CONTENT, part_content->len));
msg_info_task ("detected charset: %s", charset);
checked = TRUE;
+ text_part->real_charset = charset;
}
}
@@ -730,6 +733,7 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
rspamd_mime_text_part_ucs_from_utf (task, text_part);
rspamd_mime_text_part_normalise (task, text_part);
rspamd_mime_text_part_maybe_renormalise (task, text_part);
+ text_part->real_charset = UTF8_CHARSET;
return;
}
@@ -748,6 +752,8 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
text_part->utf_raw_content = part_content;
return;
}
+
+ text_part->real_charset = charset;
}
SET_PART_UTF (text_part);