You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR brings the work on the v2.0 branch into master for the next major release of ImapEngine.
I've expanded the library to support applications that need to keep a local mailbox in sync, listen for mailbox changes, and fetch only the message data they need.
What's changed
Incremental synchronization with CONDSTORE and QRESYNC, including modification sequences, conditional flag updates, and vanished messages.
Composable message fetch items for headers, bodies, envelopes, and synchronization metadata.
Separate UID ordering and server-side message sorting APIs, with UTF-8-aware SEARCH and SORT handling.
Special-use folder resolution for folders such as Sent, Drafts, and Trash using server-provided attributes.
Typed mailbox events through events(), while idle() remains focused on incoming messages and poll() provides periodic message checks.
APPEND results containing server-assigned UID information when available, support for message internal dates, and targeted UID EXPUNGE.
Partial body fetching and chunked attachment streams so applications can read sections without downloading the entire message into memory.
Explicit capability and folder-selection results, updated authentication handling, and corresponding support in the library's fakes.
Breaking changes
This is a major release and is not a drop-in replacement for v1. Notable changes include:
PHP 8.2 or later on a 64-bit platform is required.
Authentication configuration uses login and xoauth2 instead of plain and oauth.
Message fetch configuration and ordering use the new fetch-item and ordering APIs.
Mailbox capabilities and several connection operations return structured objects instead of their previous values.
ImapFetchIdentifier has been renamed to ImapIdentifier, and connection method signatures have changed.
Folder flags are now named attributes.
Before release
I'm opening this PR for a complete review of the v2 changes before tagging a stable release. The remaining release work is to review the public APIs and upgrade documentation, run end-to-end checks against a real IMAP server, and validate the Laravel integration against this branch. Any issues found during that integration work can be addressed here before v2 ships.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
Unresolved issues can target EXPUNGE at the wrong folder, corrupt literal arguments, stop IDLE after transport loss, and lose fake repository mutations.
Determining whether each filtered group is empty can exhaust a compact server range one UID at a time. For example, filtering VANISHED 1:4294967295 against a non-overlapping exact request iterates billions of values before returning, so a compact response can pin the process despite bounded memory. Intersect compact ranges before expansion and only expose the intersection lazily.
Restore the socket timeout after IDLE completes
src/Connection/IdleSession.php:167
Each IDLE read overwrites the socket timeout, but the previous configured timeout is never restored when the session finishes successfully. The next normal IMAP command therefore inherits the last renewal/completion timeout and may fail prematurely or block longer than configured. Preserve the connection’s prior read timeout and restore it when IDLE ends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings the work on the
v2.0branch intomasterfor the next major release of ImapEngine.I've expanded the library to support applications that need to keep a local mailbox in sync, listen for mailbox changes, and fetch only the message data they need.
What's changed
events(), whileidle()remains focused on incoming messages andpoll()provides periodic message checks.Breaking changes
This is a major release and is not a drop-in replacement for v1. Notable changes include:
loginandxoauth2instead ofplainandoauth.ImapFetchIdentifierhas been renamed toImapIdentifier, and connection method signatures have changed.Before release
I'm opening this PR for a complete review of the v2 changes before tagging a stable release. The remaining release work is to review the public APIs and upgrade documentation, run end-to-end checks against a real IMAP server, and validate the Laravel integration against this branch. Any issues found during that integration work can be addressed here before v2 ships.