fix: encode chat name in the List-ID header

List-ID header is added for broadcast lists.
UTF-8 in email headers is allowed only if
all recipient MTAs support SMTPUTF8 extension,
which is not always the case even if our submission service
reports SMTPUTF8 support.
This commit is contained in:
link2xt
2023-11-12 13:13:10 +00:00
committed by holger krekel
parent fcbb66a788
commit 091bc1ab13

View File

@@ -596,9 +596,10 @@ impl<'a> MimeFactory<'a> {
if let Loaded::Message { chat } = &self.loaded {
if chat.typ == Chattype::Broadcast {
let encoded_chat_name = encode_words(&chat.name);
headers.protected.push(Header::new(
"List-ID".into(),
format!("{} <{}>", chat.name, chat.grpid),
format!("{encoded_chat_name} <{}>", chat.grpid),
));
}
}