mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
Imap.select_with_uidvalidity(): read all the IMAP responses
This commit is contained in:
committed by
link2xt
parent
b83f3e5ea0
commit
ea0aa4a93f
@@ -573,8 +573,14 @@ impl Imap {
|
|||||||
let set = format!("{}", mailbox.exists);
|
let set = format!("{}", mailbox.exists);
|
||||||
match session.fetch(set, JUST_UID).await {
|
match session.fetch(set, JUST_UID).await {
|
||||||
Ok(mut list) => {
|
Ok(mut list) => {
|
||||||
if let Some(Ok(msg)) = list.next().await {
|
let mut new_last_seen_uid = None;
|
||||||
msg.uid.unwrap_or_default()
|
while let Some(fetch) = list.next().await.transpose()? {
|
||||||
|
if fetch.message == mailbox.exists && fetch.uid.is_some() {
|
||||||
|
new_last_seen_uid = fetch.uid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(new_last_seen_uid) = new_last_seen_uid {
|
||||||
|
new_last_seen_uid
|
||||||
} else {
|
} else {
|
||||||
return Err(Error::Other("failed to fetch".into()));
|
return Err(Error::Other("failed to fetch".into()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user