Repository navigation
feat/stream Support seekable streams in modern IMAP APPEND - #59
Merged
Merged
Conversation
PR Summary
|
A `binary: true` entry is sent as literal8 even when it contains no NUL, for strings and streams alike, and requires BINARY. Servers may normalize line endings of ordinary literals (Dovecot stores bare LF as CRLF), which corrupts bodies that must be stored byte for byte, such as Content-Transfer-Encoding: binary.
ralflang
added a commit
that referenced
this pull request
Nov 3, 2026
Release version 3.2.0 test: Cover validation of range handling fix: regression in SORT fix: Issue #62 handle sequence range expansion in a memory safe way docs(append): Add upgrading instructions for binary and catenate handling test: Add Binary Catenate correctness tests feat(append): Handle the binary: true & catenate scenario according to spec Merge pull request #59 from neuhaus/feat/modern-append-streams Merge branch 'FRAMEWORK_6_0' into feat/modern-append-streams Read complete IMAP literals across short socket reads Add decoded partial BINARY FETCH to the modern IMAP API Polish binary APPEND documentation Use local assembly for binary CATENATE inputs Add opt-in byte-preserving binary APPEND to legacy socket Allow forcing literal8 in modern IMAP APPEND Support seekable streams in modern IMAP APPEND
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The modern
ImapClient::append()currently accepts message data as strings. This requires callers to load large MIME messages into memory before uploading.This change adds support for readable, seekable PHP stream resources:
Behavior
ImapWireStream::CHUNK_SIZE), without materializing the entire message or making a temporary copy.binary: trueentry forces literal8 for strings and streams without NUL, also requiring BINARY. Servers may normalize line endings of ordinary literals (Dovecot stores bare LF as CRLF), so this keeps bodies that must be stored byte for byte intact.Callers must provide complete, correctly formed MIME messages. Non-seekable sources must be spooled by the caller first. Existing string and CATENATE inputs and the legacy API remain unchanged.
The change also preserves response codes on rejected literal announcements, allowing TRYCREATE handling before payload transmission, and releases pending commands when transmission fails.
Validation
binary: trueare returned byte for byte by Dovecot.This branch is based directly on
FRAMEWORK_6_0.