diff --git a/src/imap.rs b/src/imap.rs index 6492cae56..a92bdf8b5 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -569,6 +569,7 @@ impl Imap { info!(context, "No new emails in folder {folder:?}."); return Ok(false); } + info!(context, "Setting new_mail to False"); session.new_mail = false; let mut read_cnt = 0; @@ -1237,6 +1238,7 @@ impl Session { // have been modified while our request was in progress. // We may or may not have these new flags as a part of the response, // so better skip next IDLE and do another round of flag synchronization. + info!(context, "got unsolicited fetch in folder"); self.new_mail = true; } diff --git a/src/imap/idle.rs b/src/imap/idle.rs index 0a5217a61..ff7f48927 100644 --- a/src/imap/idle.rs +++ b/src/imap/idle.rs @@ -30,13 +30,17 @@ impl Session { self.select_with_uidvalidity(context, folder).await?; if self.drain_unsolicited_responses(context)? { + info!( + context, + "Setting new_mail to True" + ); self.new_mail = true; } if self.new_mail { info!( context, - "Skipping IDLE in {folder:?} because there may be new mail." + "YES YES YES Skipping IDLE in {folder:?} because there may be new mail." ); return Ok(self); }