fix: Mark message as failed if it can't be send (#7143)

resolves #6849
This commit is contained in:
Nico de Haen
2025-09-02 14:32:25 +02:00
committed by GitHub
parent 6b338a923c
commit 143ba6d5e7

View File

@@ -3003,7 +3003,16 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
}
let needs_encryption = msg.param.get_bool(Param::GuaranteeE2ee).unwrap_or_default();
let mimefactory = MimeFactory::from_msg(context, msg.clone()).await?;
let mimefactory = match MimeFactory::from_msg(context, msg.clone()).await {
Ok(mf) => mf,
Err(err) => {
// Mark message as failed
message::set_msg_failed(context, msg, &err.to_string())
.await
.ok();
return Err(err);
}
};
let attach_selfavatar = mimefactory.attach_selfavatar;
let mut recipients = mimefactory.recipients();