Repository navigation
Description
Received Email overhaul, accepted 10 November 2026
Protected input currently makes callers choose between ordinary content, a decrypted attachment list and retained inner Email details. The flattened protection result also cannot explain whether the particular document or native body fallback an application uses is covered.
Email received = mail.converter().fromEml(input).toEmail();
received.getDecryptedAttachments();
received.getOriginalSmimeDetails();Complete this unreleased feature with one readable logical Email: ordinary getters and attachment streams expose successfully opened content, while a passive attachment child getter keeps an attached email's content with that child. Retain complete supplied originals separately and provide field/resource inspection that distinguishes actual verification, coverage, decryption and unavailable evidence. Applications can check one selected value against explicit approved signing keys and small reusable protection requirements.
Copies preserve unchanged evidence; edits stop inheriting old protection claims. Interpreted forwarding uses represented content, and original forwarding deliberately carries retained input in its captured format. Replies and forwards that automatically reuse confidential content require suitable outgoing protection, draft permission or conversion-local permission at final output. Safe public subjects and header ownership remain independent of that permission.
This follows ADRs 0008, 0031, 0035, 0036, 0040 and 0041. It includes both protection families introduced under #704, receiving guidance and the protected-partners application under #764, and released-to-target migration contributions under #766. Those broader projects keep their own scope. The earlier request and delivered follow-ups remain below.
Embedded Outlook address recovery, accepted 8 November 2026 When an Outlook message contains an embedded MSG, recovering a malformed optional address in that child is missing from the parent Email's Problems list. Importing the child on its own reports the same recovery. java // child.msg has valid From, To and body, plus: // Disposition-Notification-To: , // parent.msg contains child.msg as an embedded MSG. Email child = EmailConverter.outlookMsgToEmail(new File("child.msg")); Email parent = EmailConverter.outlookMsgToEmail(new File("parent.msg")); child.getProblems(); // Includes the address-recovery observation. parent.getProblems(); // Currently omits that child observation. Keep the tolerant address value and generated EML attachment, and include the recovery once in the parent Email's Problems list. Link it to the captured child source occurrence, preserve the child's original input identity and qualify its location within the parent. Copies and serialization must retain those same identities and links. Apply this to address recovery performed while materializing embedded MSG messages. Healthy children and deliberately unused source values need no new Problem. Keep nested receipt fields on the child, and preserve readable neighboring content, selected-content reads, cancellation and ordinary attachment ownership. This completes the unreleased inspection feature under ADR 0035 and ADR 0041. It adds no public API or setting and does not require a migration from released 9.x behavior. --- ### Sender fallback observations, accepted 7 November 2026 When From is absent, a malformed Sender can supply the existing raw fallback for both From and Reply-To. The readable message survives, but the address recovery is missing from Email.getProblems(). java Email received = mail.converter().fromEml( "Sender: broken <address\r\n" + "Content-Type: text/plain\r\n\r\nReadable body" ).toEmail(); // The raw From/Reply-To fallback is retained, but no Problem describes its recovery. Keep that tolerant fallback and add one observation linked to the captured Sender header. From and Reply-To using the same source should share the observation. Preserve its original input identity and source references through copies and serialization, along with readable neighboring fields and content. Record this only when the Sender fallback actually recovers a grammar failure. A deliberately unused Sender should not gain another decoding or validation pass, and successful provider interpretations remain authoritative. Existing address selection, outgoing validation, content failures, cancellation and unrelated application failures keep their behavior. This completes the unreleased inspection feature under ADR 0035 and ADR 0041. No new API, setting or released-source migration is needed. --- ### Optional fields without captured fallback text, accepted 7 November 2026 A recognized address-reader failure can still prevent inspection of an otherwise readable message when no raw address header was captured. Recovery creates an address object with no address, which fails while mapping the result into Email. java String eml = "Subject: Readable message\r\n\r\nReadable body"; MimeMessage source = new MimeMessage(session, new ByteArrayInputStream(eml.getBytes(UTF_8))) { @Override public Address[] getFrom() throws MessagingException { throw new MessagingException("Sender information unavailable"); } }; Email received = mail.converter().fromMimeMessage(source).toEmail(); Leave a failed singular address unavailable and a failed address list empty when no captured fallback text exists. Retain the existing Problem, original input identity and any available source references, and preserve readable neighboring fields and content. When raw text exists, retain the established recovery behavior and successful provider interpretations. A disposition getter can fail even when a successful direct header lookup establishes that no Content-Disposition was supplied. When neither that lookup nor captured source contains a disposition declaration, leave disposition unavailable and continue interpreting readable content. A present, conflicting or unreadable declaration retains its existing component boundary, especially for attached multipart children. Apply the same absence rule to analogous optional-field recovery paths. Do not manufacture a typed placeholder from missing evidence, weaken Recipient invariants, change From/Sender selection, broaden exception catching or alter strict outgoing validation. Cancellation, unrelated application failures, content acquisition and stream ownership keep their existing contracts. This completes the unreleased inspection behavior in ADR 0035 and ADR 0041. No public API, setting or released-source migration is added. --- ### Delivery-report warning sources, accepted 6 November 2026 A delivery report can correctly warn about an unknown Action while leaving the warning's source list empty. The affected MIME part is already known, so an inspector cannot follow the observation back to that part through the public source graph. java String eml = "Content-Type: message/delivery-status\r\n\r\n" + "Reporting-MTA: dns; mx.example.org\r\n\r\n" + "Final-Recipient: rfc822; missing@example.org\r\n" + "Action: sideways\r\nStatus: 5.1.1\r\n"; Email received = mail.converter().fromEml(eml).toEmail(); EmailProblem warning = received.getProblems().stream() .filter(p -> p.getCode() == EmailProblem.Code.INTERPRETATION_WARNING) .findFirst().orElseThrow(); warning.getSources(); // Empty although the delivery-status part is known. Link semantic report warnings to the affected immutable source part, including known candidate parts when the report is ambiguous. Keep the existing interpretation, warning text, source identities and payload ownership. Attaching a reference must not read the content again or retain another copy of successfully represented bytes. Copies and serialization preserve the links. This completes the existing unreleased inspection contract in ADR 0041, alongside the tolerant report interpretation in ADR 0035. No new public method or parser setting is needed. --- ### Failed delivery-report source retention, accepted 6 November 2026 A deferred delivery-report read can consume a completed block and a partial next block before failing. The Email retains usable report facts, but its source graph loses the acquired prefix and its generic warning does not identify the affected source part. java // The delivery-status stream returns a prefix, then throws IOException. Email received = mail.converter().fromMimeMessage(notification) .withFetchAttachmentData(false).toEmail(); Retain whatever report bytes the selected read actually acquired, with incomplete capture explicit after a read failure. Link the read or close observation to the affected source part. Preserve readable neighbors, completed report facts, original failure context, borrowed-resource identity and stream cleanup. Use the same single selected read. Do not fetch another copy for diagnostics, eagerly read unrelated deferred resources or change a later ordinary attachment read into an update of historical Problems. Successful represented content still needs no duplicate source archive. Copies and serialization preserve the immutable retained prefix and links. This completes the existing unreleased inspection contract in ADR 0041, with ADR 0035 governing optional recovery and ADR 0036 governing read ownership. Cancellation and unrelated application failures keep their existing exception behavior. --- Converting a received email can fail because one body, attachment or other field cannot be interpreted, leaving callers unable to inspect the readable parts. Successful conversion can also hide received information behind normalized fields or a different content format. For example, outgoing headers omit received transport fields, and HTML generated from an Outlook RTF body does not expose that original RTF through the normal Email body getters. java String eml = "From: sender@example.org\r\n" + "Subject: Readable subject\r\n" + "MIME-Version: 1.0\r\n" + "Content-Type: text/plain; charset=X-NO-SUCH-CHARSET\r\n" + "\r\nOriginal body data"; Email received = mail.converter().fromEml(eml).toEmail(); // Before this overhaul: the unsupported body charset aborts the import, // preventing even the readable subject and received headers from being inspected. There is also a separate source-visibility gap after successful conversion: java Email received = mail.converter().fromEml(bytes).toEmail(); // Comments and transport headers are omitted from this outgoing header map. received.getHeaders(); A required attachment read can likewise abort the import. Callers need one Email they can inspect, containing what was successfully interpreted and enough retained evidence to understand what was different or could not be interpreted. ## Accepted direction for unreleased 10.0.0 Email is the inspection result. Keep successfully represented bodies, attachments and embedded images in their existing normal fields and collections. Expose immutable received evidence through Email.getSourceData() and historical processing observations through Email.getProblems(). A returned Email is non-null even when only source evidence, metadata and problems are available. Do not add invalid-resource placeholders or recovery states to AttachmentResource, or wrap an Email in another conversion-result object. Source data is an enumerable diagnostic view of headers, reader-exposed native properties, parts and materialized derived views. Preserve available header occurrences, spelling, raw values and order, including headers excluded from outgoing composition. Keep the existing specialized Outlook conversion-result API usable, while making ordinary MSG-to-Email inspection available through Email itself. Generic source inspection should not require callers to know a failed header or property name in advance. Retain available original content that is not exposed as received in the root Email, except for different representations of the same canonical value. Successful Base64 decoding preserves the attachment content normally and needs no extra raw payload. If an RTF body becomes HTML, retain the reader-provided original RTF as source evidence. A naming fallback retains the original naming metadata without duplicating unchanged attachment bytes. A failed content read retains whatever source bytes or prefix were actually acquired, with incomplete capture explicit. Do not invent unavailable bytes or retain a second full raw archive of otherwise represented content. Retained originals and Problems are independent. A successful expected RTF-to-HTML conversion can retain its original without a Problem. Record actual interpretation, read, recovery and protection issues; do not create a problem-lineage entry for every conversion difference. Callers must be able to enumerate source data even when the Problems list is empty. Use best-effort conversion to preserve readable neighbors and report the rest, without guessing decoded values or introducing a SourceContentOmissionPolicy or problem-count send gate. For EML bytes, EML text and MimeMessage outputs, provide optional diagnostic result terminals carrying the usable artifact, new observations and available source evidence. Direct and diagnostic terminals use the same conversion behavior. An unfinished output buffer is not a usable artifact. Invalid usage, cancellation and unrelated application failures retain their exception behavior. Problems capture an immutable original input identity: its observed Message-ID when available and a stable diagnostic reference. Copies preserve those identities, Problems and captured sources without reinspection or accumulation. Later setters affect normal content without changing that history; no matching by filename, position or outgoing coordinates reconciles old findings. Result diagnostics describe observations newly made during that operation rather than replaying inherited Email history. The immutable input Email is never used as an output-operation log. Respect selected eager/deferred reading and existing stream ownership. Diagnostic getters, copies and source-graph serialization do not fetch external data, retry interpretation or run crypto. Share immutable retained storage and avoid retaining an entire successful input allocation for one small exceptional region. Raw sources are not automatically rendered into outgoing mail, logs or telemetry. Existing exact/protected-byte guarantees and new-output completion/history boundaries remain intact. ADR 0041 records the accepted inspection rules alongside ADR 0035, ADRs 0008/0013/0036/0037/0040 and the existing Outlook decision under #609/#614. Restoring the entire Java-serialized Email without optional producer modules is deferred to child #965. The new source/problem graph is core-owned, but broadening older whole-Email serialization compatibility is outside this feature and does not block completing it. ## Accepted follow-up, 5 November 2026 Combined static MSG conversions can lose an input acquisition or format failure while passing through the source-only inspection Email, then return an empty generated artifact: java String eml = EmailConverter.outlookMsgToEML( new ByteArrayInputStream(new byte[0])); Keep the original failure through a combined MSG-to-MIME or MSG-to-EML operation, so its direct terminal throws instead of presenting a blank artifact as the conversion. Ordinary MSG-to-Email still returns an inspectable Email, and an application may explicitly choose to export that Email later. Preserve the static API's input-stream ownership and the fluent API's borrowed-stream behavior. Automatic interpretation of one malformed independent signed attachment can also prevent access to its readable parent: java // The EML has readable text and a broken.p7m attachment declared as // application/pkcs7-mime; smime-type=signed-data, with non-CMS bytes. Email received = mail.converter().fromEml(eml).toEmail(); Retain the readable parent, the original malformed resource and available source evidence. Record a Problem linked to that child and continue with neighboring components, without promoting a child's failure to message-level protection facts. Preserve explicit wrong-key/password behavior, direct low-level helper exceptions, cancellation and unrelated application failures. These corrections complete the existing unreleased inspection and artifact contracts in ADR 0041, with ADR 0035 governing component recovery and ADR 0008 governing protection facts. They add no public setting, historical-problem send gate or new migration recipe.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(email): explain source inspection and artifact diagnostics (#961)
feat(email): inspect retained sources and processing problems (#961)
bbottema commentedon Nov 4, 2026
Email now keeps usable content in its ordinary getters and makes received evidence and processing problems inspectable alongside it.
A known failure in one component can retain its available original or partial content without hiding readable neighbors.
Originals are retained when the normal Email no longer exposes what was received. For example, RTF remains inspectable alongside generated
HTML, without treating that successful conversion as a Problem. Equivalent decoding, such as Base64 attachment decoding, needs no duplicate
raw payload. Source parts can therefore retain originals even when there are no Problems.
Copies keep their captured sources and original problem identities. Later edits change normal content without rewriting that history.
Diagnostic source reads use captured data; they do not fetch missing resources, retry interpretation or run protection processing.
For EML bytes/text and MimeMessage outputs, the optional result terminals return new observations and available sources alongside the
artifact. Email imports continue to return Email directly. Existing exact/protected-byte and outgoing-validation rules remain independent.
Delivered on
codex/10.0.0andcodex/10.0.0-contentfor 10.0.0 (unreleased). Broader whole-Email restoration without optional producermodules remains deferred under #965.
Architecture: ADR 0041.
Delivered commits: Email inspection and conversion, website guidance.
63 remaining items
bbottema commentedon Nov 8, 2026
Address observations from receipt destinations and Return-Path in embedded Outlook messages now appear once in the parent Email's Problems list, with qualified locations and the child's original source links. Copying and serialization retain those identities and links. Native Reply-To selection and tolerant address interpretation keep their existing behavior; unused raw headers remain source evidence.
Delivered on the 10.0.0 development branch in the converter change, with library guidance and website guidance. This completes the unreleased inspection follow-up under ADR 0035 and ADR 0041. The changes will be available with 10.0.0.
feat(email): expose one readable view of received messages (#961)
bbottema commentedon Nov 11, 2026
The received-message follow-up is complete on the 10.0.0 development branches. Conversion exposes the usable selected bodies and files through ordinary
Emailgetters. An attached message keeps its own passiveAttachmentResource.getEmail()view, and complete captured originals stay separately available.The application chooses the required document and explicitly approves the signing key.
forwarding(received)uses the current interpreted view;forwardingOriginal(received)attaches the retained input. Helpers that reuse confidential content require suitable outgoing encryption or explicit permission, while keeping a safe public subject.See the received-mail migration guidance on the website development branch and the logical message selection decision. The wider migration tooling remains tracked in #766.
Main change · Website and examples
fix(email): guard private headers and retain Outlook images (#961)
fix(email): protect private receipt destinations in forwards (#961)
fix(converter): retain unavailable calendar inspection (#961)
docs(plans): preserve received-email planning history (#961)
docs(plans): retire superseded received-email plans (#961)
docs(journal): update SJM 10 release stories (#699, #704, #763, #961)