diff --git a/src/dc_mimefactory.rs b/src/dc_mimefactory.rs index ba06f22c7..9523b78cb 100644 --- a/src/dc_mimefactory.rs +++ b/src/dc_mimefactory.rs @@ -141,6 +141,7 @@ pub fn dc_mimefactory_load_msg(context: &Context, msg_id: u32) -> Result\r\nDisposition: manual-action/MDN-sent-automatically; displayed\r\n", @@ -673,6 +696,9 @@ pub unsafe fn dc_mimefactory_render( } }; + /* Encrypt the message + *************************************************************************/ + mailimf_fields_add( imf_fields, mailimf_field_new( @@ -701,6 +727,7 @@ pub unsafe fn dc_mimefactory_render( ptr::null_mut(), ), ); + let mut e2ee_helper = E2eeHelper::default(); if force_plaintext != DC_FP_NO_AUTOCRYPT_HEADER { e2ee_helper.encrypt( @@ -743,6 +770,7 @@ fn get_subject( let fwd = if afwd_email { "Fwd: " } else { "" }; if msg.param.get_cmd() == SystemMessage::AutocryptSetupMessage { + /* do not add the "Chat:" prefix for setup messages */ context .stock_str(StockMessage::AcSetupMsgSubject) .into_owned() @@ -804,6 +832,10 @@ fn build_body_file(context: &Context, msg: &Message, base_name: &str) -> (*mut m Some(path) => path, }; let suffix = dc_get_filesuffix_lc(path_filename).unwrap_or_else(|| "dat".into()); + + /* get file name to use for sending + (for privacy purposes, we do not transfer the original filenames eg. for images; + these names are normally not needed and contain timestamps, running numbers etc.) */ let filename_to_send = match msg.type_0 { Viewtype::Voice => chrono::Utc .timestamp(msg.timestamp_sort as i64, 0) @@ -829,6 +861,7 @@ fn build_body_file(context: &Context, msg: &Message, base_name: &str) -> (*mut m .unwrap_or_default(), }; + /* check mimetype */ let mimetype = match msg.param.get(Param::MimeType) { Some(mtype) => mtype, None => {