Imap.delete_msg(): warn about unexpected FETCH responses

Such responses indicate IMAP client or server bug.
This commit is contained in:
Alexander Krotov
2020-08-04 01:00:00 +03:00
committed by link2xt
parent 8faf397af2
commit 1bfc8d0300

View File

@@ -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();