From e30517e62c62c9c255b51d233abface24b12c42a Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 14 Oct 2023 03:29:20 +0000 Subject: [PATCH] refactor: log MDN sending errors --- src/smtp.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smtp.rs b/src/smtp.rs index 0b688817d..de9b8915b 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -787,9 +787,10 @@ async fn send_mdn(context: &Context, smtp: &mut Smtp) -> Result { .context("failed to update MDN retries count")?; let res = send_mdn_msg_id(context, msg_id, contact_id, smtp).await; - if res.is_err() { + if let Err(ref err) = res { // If there is an error, for example there is no message corresponding to the msg_id in the // database, do not try to send this MDN again. + warn!(context, "Error sending MDN for {msg_id}, removing it: {err:#}."); context .sql .execute("DELETE FROM smtp_mdns WHERE msg_id = ?", (msg_id,))