From 62b50c87d4205f7597c8ebf048f74fdb288a9c72 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 29 May 2022 17:14:07 +0000 Subject: [PATCH] Delete outgoing MDNs detected in the Sent folder Gmail saves all outgoing messages to the Sent folder, including MDNs. Delete MDNs sent by Delta Chat immediately to keep DeltaChat or INBOX clean. --- CHANGELOG.md | 1 + src/dc_receive_imf.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69dd583ea..f1296dbc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changes - refactorings #3373 +- delete outgoing MDNs found in the Sent folder on Gmail #3372 ## 1.84.0 diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 22eac3182..76c786608 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -1174,6 +1174,13 @@ INSERT INTO msgs } } + if !incoming && is_mdn && is_dc_message == MessengerMessage::Yes { + // Normally outgoing MDNs sent by us never appear in mailboxes, but Gmail saves all + // outgoing messages, including MDNs, to the Sent folder. If we detect such saved MDN, + // delete it. + needs_delete_job = true; + } + Ok(ReceivedMsg { chat_id, state,