diff --git a/CHANGELOG.md b/CHANGELOG.md index 11cb919e1..4a72189f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Compress `mime_headers` column with HTML emails stored in database - Strip BIDI characters in system messages, files, group names and contact names #3479 - maybe_add_time_based_warnings(): Use release date instead of the provider DB update one +- Remove confusing log line "ignoring unsolicited response Recent(…)" #3934 - Cleanly terminate deltachat-rpc-server. Also terminate on ctrl-c. - Refactorings #4317 diff --git a/src/imap.rs b/src/imap.rs index 2de7b666d..a82b45a0a 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -1740,17 +1740,37 @@ impl Session { /// If this returns `true`, this means that new emails arrived and you should /// fetch again, even if you just fetched. fn server_sent_unsolicited_exists(&self, context: &Context) -> Result { + use async_imap::imap_proto::Response; + use async_imap::imap_proto::ResponseCode; + use UnsolicitedResponse::*; + let mut unsolicited_exists = false; while let Ok(response) = self.unsolicited_responses.try_recv() { match response { - UnsolicitedResponse::Exists(_) => { + Exists(_) => { info!( context, "Need to fetch again, got unsolicited EXISTS {:?}", response ); unsolicited_exists = true; } - _ => info!(context, "ignoring unsolicited response {:?}", response), + + // We are not interested in the following responses and they are are + // sent quite frequently, so, we ignore them without logging them + Expunge(_) | Recent(_) => {} + Other(response_data) + if matches!( + response_data.parsed(), + Response::Fetch { .. } + | Response::Done { + code: Some(ResponseCode::CopyUid(_, _, _)), + .. + } + ) => {} + + _ => { + info!(context, "got unsolicited response {:?}", response) + } } } Ok(unsolicited_exists)