Skip to content

Conversation

@link2xt
Copy link
Collaborator

@link2xt link2xt commented Nov 6, 2023

Ensure the client does not busy loop
skipping IDLE if UIDNEXT of the mailbox is higher than the last seen UID plus 1, e.g. if the message
with UID=UIDNEXT-1 was deleted before we fetched it.

We do not fallback to UIDNEXT=1 anymore
if the STATUS command cannot determine UIDNEXT.
There are no known IMAP servers with broken STATUS so far. This allows to guarantee that select_with_uidvalidity() sets UIDNEXT for the mailbox and use it in fetch_new_messages() to ensure that UIDNEXT always advances even
when there are no messages to fetch.

Fixes #4935

src/imap.rs Outdated
//
// In particular, Winmail Pro Mail Server 5.1.0616
// never returns UIDNEXT in SELECT response,
// but responds to "SELECT INBOX (UIDNEXT)" command.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"STATUS INBOX (UIDNEXT)"?

…a loop

Ensure the client does not busy loop
skipping IDLE if UIDNEXT of the mailbox is higher than
the last seen UID plus 1, e.g. if the message
with UID=UIDNEXT-1 was deleted before we fetched it.

We do not fallback to UIDNEXT=1 anymore
if the STATUS command cannot determine UIDNEXT.
There are no known IMAP servers with broken STATUS so far.
This allows to guarantee that select_with_uidvalidity()
sets UIDNEXT for the mailbox and use it in fetch_new_messages()
to ensure that UIDNEXT always advances even
when there are no messages to fetch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDLE is skipped in an infinite loop if UIDNEXT is larger than the stored but there is no message with UID=UIDNEXT-1

3 participants