Skip to content

Improve APPEND results and safely expunge specific messages - #181

Merged
stevebauman merged 2 commits into
v2.0from
feature/v2-append-result
Sep 1, 2026
Merged

Improve APPEND results and safely expunge specific messages#181
stevebauman merged 2 commits into
v2.0from
feature/v2-append-result

Conversation

@stevebauman

Copy link
Copy Markdown
Member

IMAP servers can successfully append a message without returning APPENDUID when UIDPLUS is unavailable. The current append API assumes that response is always present and returns only an integer UID, which prevents callers from handling a successful append without identifiers. It also does not allow the optional APPEND internal date to be supplied.

Deleting a specific message with expunge enabled currently follows the flag update with a mailbox-wide EXPUNGE. That can permanently remove other messages which were already marked as deleted by another client.

This introduces an AppendResult containing nullable UID validity and UID values, adds optional internal-date support to APPEND, and allows expunge operations to target exact UIDs through UID EXPUNGE. Message and query deletion now use their known UIDs, while MOVE no longer performs a redundant mailbox-wide expunge after the server has already removed the source messages.

This targets v2.0 because changing append from an integer or tagged response to AppendResult is a breaking API change.

@stevebauman
stevebauman merged commit 00d74f4 into v2.0 Sep 1, 2026
13 checks passed
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.

1 participant