mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 18:06:35 +03:00
switch to quoted-printable, which is already used by mailparse
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use chrono::TimeZone;
|
||||
use lettre_email::{mime, Address, Header, MimeMultipartType, PartBuilder};
|
||||
use rfc2047::rfc2047_encode;
|
||||
|
||||
use crate::chat::{self, Chat};
|
||||
use crate::config::Config;
|
||||
@@ -383,7 +382,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
let mut unprotected_headers: Vec<Header> = Vec::new();
|
||||
|
||||
let from = Address::new_mailbox_with_name(
|
||||
rfc2047_encode(&self.from_displayname).into_owned(),
|
||||
quoted_printable::encode_to_str(&self.from_displayname),
|
||||
self.from_addr.clone(),
|
||||
);
|
||||
|
||||
@@ -395,7 +394,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
to.push(Address::new_mailbox(addr.clone()));
|
||||
} else {
|
||||
to.push(Address::new_mailbox_with_name(
|
||||
rfc2047_encode(name).into_owned(),
|
||||
quoted_printable::encode_to_str(name),
|
||||
addr.clone(),
|
||||
));
|
||||
}
|
||||
@@ -451,7 +450,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
let e2ee_guranteed = self.is_e2ee_guranteed();
|
||||
let mut encrypt_helper = EncryptHelper::new(self.context)?;
|
||||
|
||||
let subject = rfc2047_encode(&subject_str).into_owned();
|
||||
let subject = quoted_printable::encode_to_str(&subject_str);
|
||||
|
||||
let mut message = match self.loaded {
|
||||
Loaded::Message => {
|
||||
@@ -611,7 +610,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
if chat.typ == Chattype::Group || chat.typ == Chattype::VerifiedGroup {
|
||||
protected_headers.push(Header::new("Chat-Group-ID".into(), chat.grpid.clone()));
|
||||
|
||||
let encoded = rfc2047_encode(&chat.name).into_owned();
|
||||
let encoded = quoted_printable::encode_to_str(&chat.name);
|
||||
protected_headers.push(Header::new("Chat-Group-Name".into(), encoded));
|
||||
|
||||
match command {
|
||||
@@ -994,7 +993,7 @@ fn build_body_file(
|
||||
// XXX do we need to encode filenames?
|
||||
format!(
|
||||
"attachment; filename*=\"{}\"",
|
||||
rfc2047_encode(&filename_to_send)
|
||||
quoted_printable::encode_to_str(&filename_to_send)
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user