Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(imap): Chunk UIDs by string length #8367

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

ChristophWurst
Copy link
Member

IMAP sync requires an IMAP FETCH command that fetches specific messages. If the full mailbox has to be sync'ed, that can be a long list of UIDs.

The synchronizer had already broken UIDs into chunks by a maximum chunk size. Yet the chunk size does not correlate with the resulting IMAP FETCH command length.

An advanced chunk function calculates the UID range string and decreases the chunk size until the UIDs produce a string that fits the given byte size.

Fixes #6038

IMAP sync requires an IMAP FETCH command that fetches specific messages.
If the full mailbox has to be sync'ed, that can be a long list of UIDs.

The synchronizer had already broken UIDs into chunks by a maximum chunk
size. Yet the chunk size does not correlate with the resulting IMAP
FETCH command length.

An advanced chunk function calculates the UID range string and decreases
the chunk size until the UIDs produce a string that fits the given byte
size.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

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

Looks gut, better than doing the highest and lowest only. Tested, works, although I'm not sure I could reproduce with my mailbox.

@ChristophWurst
Copy link
Member Author

Bildschirmfoto vom 2023-04-12 19-42-31

there is also no significant performance regression

@miaulalala miaulalala merged commit 8cc8251 into main Apr 12, 2023
@miaulalala miaulalala deleted the fix/imap/chunk-uids-string-length branch April 12, 2023 17:54
@ChristophWurst
Copy link
Member Author

/backport to stable3.1

@ChristophWurst
Copy link
Member Author

/backport to stable2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug nextcloud-gmbh Tickets with importance for Nextcloud Gmbh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync failed: IMAP error reported by server / IMAP command too long
2 participants