From 1bfc8d030059e6a7eade9176258608da14e0a35d Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 4 Aug 2020 01:00:00 +0300 Subject: [PATCH] Imap.delete_msg(): warn about unexpected FETCH responses Such responses indicate IMAP client or server bug. --- src/imap/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/imap/mod.rs b/src/imap/mod.rs index 9264c0544..0d46d7099 100644 --- a/src/imap/mod.rs +++ b/src/imap/mod.rs @@ -1085,6 +1085,22 @@ impl Imap { return ImapActionResult::AlreadyDone; }; + if let Some(fetched_uid) = fetch.uid { + if fetched_uid != uid { + warn!( + context, + "IMAP bug: fetched UID {} is not equal to requested UID {}", + fetched_uid, + uid + ); + } + } else { + warn!( + context, + "IMAP bug: fetch result doesn't contain requested UID {}", uid + ); + } + let remote_message_id = get_fetch_headers(&fetch) .and_then(|headers| prefetch_get_message_id(&headers)) .unwrap_or_default();