mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
use utf8 lossy strings for saved mime headers (as discussed on PR and IRC with @r10s)
This commit is contained in:
@@ -598,10 +598,7 @@ unsafe fn add_parts(
|
|||||||
|
|
||||||
// if the mime-headers should be saved, find out its size
|
// if the mime-headers should be saved, find out its size
|
||||||
// (the mime-header ends with an empty line)
|
// (the mime-header ends with an empty line)
|
||||||
let save_mime_headers = context
|
let save_mime_headers = context.sql.get_config_bool(context, "save_mime_headers");
|
||||||
.sql
|
|
||||||
.get_config_int(context, "save_mime_headers")
|
|
||||||
.unwrap_or_default();
|
|
||||||
if let Some(field) = mime_parser.lookup_field_typ("In-Reply-To", MAILIMF_FIELD_IN_REPLY_TO) {
|
if let Some(field) = mime_parser.lookup_field_typ("In-Reply-To", MAILIMF_FIELD_IN_REPLY_TO) {
|
||||||
let fld_in_reply_to = (*field).fld_data.fld_in_reply_to;
|
let fld_in_reply_to = (*field).fld_data.fld_in_reply_to;
|
||||||
if !fld_in_reply_to.is_null() {
|
if !fld_in_reply_to.is_null() {
|
||||||
@@ -688,11 +685,11 @@ unsafe fn add_parts(
|
|||||||
part.param.to_string(),
|
part.param.to_string(),
|
||||||
part.bytes,
|
part.bytes,
|
||||||
*hidden,
|
*hidden,
|
||||||
if 0 != save_mime_headers {
|
if save_mime_headers {
|
||||||
Some(std::slice::from_raw_parts(
|
Some(String::from_utf8_lossy(std::slice::from_raw_parts(
|
||||||
imf_raw_not_terminated as *const u8,
|
imf_raw_not_terminated as *const u8,
|
||||||
imf_raw_bytes,
|
imf_raw_bytes,
|
||||||
))
|
)))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user