mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
Send MDNs for messages deleted on the server
Now MarkseenMsgOnImap sends MDN even if it can't mark the message as seen on the server. To prevent multiple MDNs from being sent, MarkseenMsgOnImap is postponed until the message is detected in a folder from which it is not going to be moved.
This commit is contained in:
committed by
link2xt
parent
2aa808756e
commit
7bb6890f26
16
src/job.rs
16
src/job.rs
@@ -639,7 +639,21 @@ impl Job {
|
||||
let msg = job_try!(Message::load_from_db(context, MsgId::new(self.foreign_id)).await);
|
||||
|
||||
let folder = msg.server_folder.as_ref().unwrap();
|
||||
match imap.set_seen(context, folder, msg.server_uid).await {
|
||||
|
||||
let result = if msg.server_uid == 0 {
|
||||
// The message is moved or deleted by us.
|
||||
//
|
||||
// Do not call set_seen with zero UID, as it will return
|
||||
// ImapActionResult::RetryLater, but we do not want to
|
||||
// retry. If the message was moved, we will create another
|
||||
// job to mark the message as seen later. If it was
|
||||
// deleted, there is nothing to do.
|
||||
ImapActionResult::Failed
|
||||
} else {
|
||||
imap.set_seen(context, folder, msg.server_uid).await
|
||||
};
|
||||
|
||||
match result {
|
||||
ImapActionResult::RetryLater => Status::RetryLater,
|
||||
ImapActionResult::AlreadyDone => Status::Finished(Ok(())),
|
||||
ImapActionResult::Success | ImapActionResult::Failed => {
|
||||
|
||||
Reference in New Issue
Block a user