fix: do not fake idle after trigger_reconnect()

In this case connection failure
may be a connection timeout (currently 1 minute),
so it does not make sense to fake idle for another minute immediately after.

However, failure may be immediate if the port is closed
and the server refuses connection every time.
To prevent busy loop in this case
we apply ratelimit to connection attempts rather than login attempts.
This partially reverts ccec26ffa7
This commit is contained in:
link2xt
2024-02-22 11:32:33 +00:00
parent ccd5158109
commit 671feb68a4
2 changed files with 6 additions and 19 deletions

View File

@@ -559,9 +559,6 @@ async fn fetch_idle(ctx: &Context, connection: &mut Imap, folder_meaning: Folder
{
warn!(ctx, "{:#}", err);
connection.trigger_reconnect(ctx);
connection
.fake_idle(ctx, Some(watch_folder), folder_meaning)
.await;
return;
}