mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 11:10:25 +03:00
fix: send legacy securejoin key requests as multipart/mixed
chatmail relays (filtermail) expect {vc,vg}-request
messages to be multipart/mixed with a single part.
Messages had this structure
before commit e0494b0b37
so we need to keep it for compatibility.
This commit is contained in:
@@ -1560,6 +1560,23 @@ impl MimeFactory {
|
||||
// that normally only allows encrypted mails.
|
||||
message
|
||||
} else {
|
||||
// Unencrypted message.
|
||||
let message = if let Loaded::Message { msg, .. } = &self.loaded
|
||||
&& msg.param.get_cmd() == SystemMessage::SecurejoinMessage
|
||||
&& matches!(
|
||||
msg.param.get(Param::Arg),
|
||||
Some("vc-request") | Some("vg-request")
|
||||
) {
|
||||
// Workaround for legacy SecureJoin {vc,vg}-request messages.
|
||||
// They must be sent as multipart/mixed
|
||||
// for compatibility with chatmail relays
|
||||
// that allow to send these messages unencrypted,
|
||||
// but only as long as they have this MIME structure.
|
||||
MimePart::new("multipart/mixed", vec![message])
|
||||
} else {
|
||||
message
|
||||
};
|
||||
|
||||
headers.iter().fold(message, |message, (header, value)| {
|
||||
debug_assert_ne!(*header, "from");
|
||||
debug_assert_ne!(*header, "message-id");
|
||||
|
||||
Reference in New Issue
Block a user