Repository navigation
Description
Delivery-report cancellation, accepted 6 November 2026
Optional delivery-report parsing can turn a cancelled read into a successful import when the exception identifies interruption but the thread's interrupt flag is clear.
// The delivery-status stream throws InterruptedIOException;
// the thread interrupt flag is clear.
Email received = mail.converter().fromMimeMessage(notification)
.withFetchAttachmentData(false).toEmail();Preserve cancellation from acquiring, reading or closing the selected report stream, including typed interruption and interrupted causes or suppressed failures. Use the existing conversion interruption rules; an ordinary socket timeout remains eligible for optional recovery. Preserve the caller's thread state and original failure context.
Keep completed report blocks and warnings after ordinary I/O failure, without treating a partial recipient block as complete. Unexpected application failures retain their exception behavior. This completes the unreleased report feature under ADR 0035, alongside ADR 0036 and ADR 0041. No new API or recovery setting is added.
Goal
Expose structured delivery-status report facts through the existing Email gateway. Applications convert incoming MIME/EML through the usual converter, then inspect Email.getDeliveryStatusReport(); no separate report-converter API.
Email notification = mail.converter().mimeMessageToEmailBuilder(incomingMessage).buildEmail();
DeliveryStatusReport report = notification.getDeliveryStatusReport();
if (report != null) {
applicationWorkflow.accept(report);
}Delivered design
- Immutable, serializable core read contracts:
DeliveryStatusReport,RecipientDeliveryReport,DeliveryAction,EnhancedStatusCode,ReportedRecipient,ReportedMailServerandDeliveryDiagnostic. Internal Lombok builders assemble the snapshots in the main module. - Interpret standard and internationalized delivery-status MIME structures after existing protection processing. Only the effective outer notification supplies a report; attached or forwarded reports are not promoted.
- Expose ENVID, reporting server, ordered recipient occurrences, action, checked enhanced-status components, reported addresses, diagnostics and timestamps. Optional
RecipientandSmtpServerResponseviews avoid re-parsing familiar formats while preserving unfamiliar source values. - Read imperfect mail tolerantly: recover unambiguous formatting defects with warnings, retain completed facts after optional report extraction fails, and leave missing, contradictory or ambiguous facts unavailable. An interrupted block is not presented as complete. Required content reads, thread interruption and unexpected runtime failures retain their existing failure behavior.
- Preserve copying, serialization, exact/protected source bytes and attachment behavior. Snapshots retain no live MIME objects or streams. Templates cannot manufacture received report metadata; replies and forwards do not inherit it.
- Reports are received claims, not authenticated delivery proof, read receipts or automatic retry instructions. Ingestion, trust, correlation, persistence and business actions remain application-owned.
- No new property, outgoing default/override/lock, CLI command, receiver, workflow engine or JSON dependency.
Architecture and usage
- ADR 0008: MIME and protection boundaries.
- ADR 0035: tolerant reading and strict production.
- Website walkthrough source.
Related: #736, #738, #710, #723, #756. Comparison context: the SMTP-library research companion.
The integration/Strategic Patterns portfolio remains separately tracked under #764. Its pending code, documentation and Journal/case-study changes are not part of this delivery.
Implemented for unreleased 10.0.0 on the existing feature branches; this issue does not authorize a release or completion of #764.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
bbottema commentedon Oct 16, 2026
Companion pattern-led Docker integration programme: #764. Implementation plan: docs/plans/763-delivery-status-reports.md. ADR 0008 will record the source-metadata boundary.
bbottema commentedon Oct 16, 2026
Delivery-status reports are implemented for the unreleased 10.0.0 development branch.
The converted Email exposes the received report through its ordinary API:
Example summary:
DeliveryStatusReport{recipients=3, delivered=1, delayed=1, failed=1, warnings=0}.The report model preserves standard and international fields, warnings and available source facts through copying and serialization. Reports remain received claims, not authenticated proof, a mutation of an earlier receipt, or automatic retry instructions.
See ADR 0035 for tolerant-reading behavior and the delivery-report guide for usage. Application-owned integration remains separately tracked under #764.
feat(email): expose typed received delivery reports (#763)
docs(architecture): define tolerant mail interpretation boundaries (#763
docs(delivery-reports): document feedback and competitive progress (#763
bbottema commentedon Oct 18, 2026
Implemented and accepted for 10.0.0. Convert a received notification as usual, then inspect its typed delivery report:
incomingMessageis the application's receivedMimeMessage. An ordinary email has no report. Optional fields can be absent; unfamiliar address/diagnostic formats retain their original values rather than being forced into a mailbox or SMTP reply.Malformed notifications keep whatever can be interpreted safely, with warnings. Ambiguous facts remain unavailable, and exact/protected source bytes stay authoritative. The application still decides whether to trust the notification, which submission it belongs to, and what action to take; a report is not an automatic retry instruction.
Pushed as implementation, architecture, guidance and comparison progress, and the website walkthrough.
The integration/Strategic Patterns work remains untouched under #764. This completes #763, not a published 10.0.0 release.
docs(delivery-reports): explain typed feedback and tolerant reading (b…
23 remaining items
docs(release): consolidate unreleased feature work (#488, #693, #704, #…
bbottema commentedon Nov 1, 2026
Development addenda for unreleased 10.0.0
These follow-ups complete this feature's 10.0.0 implementation. Dates identify the original development records; before examples describe earlier development revisions.
2026-10-21: Keep historical received-mail results out of template completion
Template completion should prepare outgoing content and sending choices. It should not copy results learned when an earlier message was received. At the reviewed unreleased 10.0.0 revision
8d1bfd64ed6497edccfacc9675b51b270af98ef4, crypto receive results are already omitted, but an interpreted received delivery-status report is copied into the completed Email.The maintainer clarified on 21 October 2026 that completion carries outgoing protection configuration, not historical crypto results, and that this rule applies to every historical result exposed by Email. S/MIME/OpenPGP signing and encryption, DKIM signing, and outgoing delivery-notification requests retain their existing precedence, suppression and lock rules. Applying completion does not perform cryptography itself.
Audit original S/MIME results, original OpenPGP results and their preserved original-byte snapshots, interpreted delivery reports, decrypted-attachment result views, and the retained S/MIME signed-message interpretation. The completed composed Email should have absent/plain/empty historical-result views, whether the facts occur on the supplied Email, a default or an override. Ordinary outgoing body/header/resource content remains content; this is not a rule to delete imported message content.
Reading incoming mail, ordinary copying and supported serialization keep their current historical inspection contracts. Automatic exact-Email sending/rehearsal/export retains its authoritative source; explicit template completion remains composed as clarified in #818. No public construction or new provenance API is needed.
Reconcile ADR 0002, ADR 0008, ADR 0036 and ADR 0037, public Javadocs and applicable website/migration guidance.
The maintainer approved the documentation and historical-field audit, then explicitly approved removing the received-report carryover on 21 October 2026.
Message content, outgoing headers/resources, fixed Message-ID/date, envelope/recipient choices, protection configurations and outgoing notification requests are not historical-result fields. Outlook-specific data is returned by a separate conversion result and is not an additional Email history property.
The only runtime change removes the four-line transfer of the supplied received DeliveryStatusReport. Completion now omits all five audited history groups. Existing content and exact-source behavior remain intact.
No Java signature, property, Spring binding or CLI-cache change was needed. Input copying/serialization retain their existing supported contract; the unreleased received-report correction adds no invented 9.x migration recipe.
Delivered in main commit b1e71672 on codex/10.0.0 and website commit 9257df6 on codex/10.0.0-content after the maintainer authorized completion of the workflow. Version 10.0.0 remains unreleased.
Completed behavior — 2026-10-21
Completion now leaves all audited historical result views with the source Email. Outgoing S/MIME/OpenPGP protection settings, DKIM signing and delivery-notification requests still follow their existing precedence, suppression and lock rules. Ordinary content, copying, serialization and original exact-Email preparation keep their established contracts.
The only runtime correction removes the received-report transfer; the other historical result families already followed this rule.
Delivered in main commit b1e71672 and website commit 9257df6. ADR 0002, ADR 0008, ADR 0036 and ADR 0037, public Javadocs, website guides, target-only migration fixtures and the unreleased release note agree.
This completes the reviewed work on codex/10.0.0 and codex/10.0.0-content. Version 10.0.0 has not been released.
2026-10-28: Keep delivery-report timestamps with trailing comments
A valid delivery-report timestamp becomes unavailable when a harmless trailing comment follows its numeric timezone.
After importing the delivery report, the recipient's
getLastAttemptAt()returns no timestamp and the report calls the date invalid.Will-Retry-Untilhas the same problem.Accept well-formed trailing comments and whitespace while retaining strict calendar and timezone interpretation. Malformed comments, extra non-comment text, impossible dates and missing or invalid zones must not invent a timestamp. Keep the existing ISO-date recovery behavior and neighboring report facts.
This follows ADR 0035 for 10.0.0.
Completed behavior — 2026-10-28
The recipient's
getLastAttemptAt()now retains2026-10-16T08:20:30Z;Will-Retry-Untilfollows the same rule throughgetRetryUntil(). Well-formed trailing comments and whitespace do not add a recovery warning. Invalid suffixes, calendars and timezones still leave the timestamp unavailable, and exact input bytes remain authoritative.Implemented on the 10.0.0 development branch in 1db04659c, following ADR 0035. This is not a published 10.0.0 release.
Documentation: website companion and maintained guidance.
2026-10-29: Leave delivery-report dates unavailable when timezone hours are invalid
Delivery reports can turn an impossible timezone into an apparently usable timestamp. For example, a report containing this field produces a nonnull
getLastAttemptAt()after ordinary Email conversion:Will-Retry-Untilhas the same problem. Applications reading those results can receive dates shifted by several days even though the supplied timezone is invalid.Reject numeric timezone hours outside 00 through 23 for both fields. Leave the timestamp unavailable and retain the existing invalid-date warning, neighboring recipient facts and original report content. Keep valid numeric offsets, strict calendar interpretation, well-formed trailing comments and the existing ISO-date recovery behavior.
This follows ADR 0035 for unreleased 10.0.0 and completes the invalid-zone boundary described under #763.
Completed behavior — 2026-10-29
A report field with an invalid numeric timezone such as
+9900,+2400or-2400now leaves its corresponding timestampnulland adds the existing invalid-date warning. Valid offsets, trailing comments, ISO dates, neighboring report facts and original report content retain their behavior.Implemented for unreleased 10.0.0 in 01f5eaf70, following ADR 0035. The shared documentation and website guidance describe the same behavior.
2026-10-29: Read delivery-report actions with valid comments
A delivery report can give a clear action with a valid comment, but importing it currently reports
UNKNOWNbecause the parser includes the comment when looking up the action.Read exactly one recognized action token while ignoring well-formed external comments and whitespace. Apply this to all five standard actions, retaining case-insensitive interpretation and adding no warning for valid comments. Missing or unknown actions, extra tokens, quoted values, malformed comments and existing contradictory-field cases must remain unavailable through UNKNOWN and the existing warnings.
Preserve the original report content, exact/protected bytes, neighboring recipient facts and the existing duplicate-field rules. This changes no public API or configuration.
This follows RFC 3464 section 2.1.1, ADR 0035 and ADR 0008, for the unreleased 10.0.0 branch.
Completed behavior — 2026-10-29
A recognized action now remains available when the field contains valid external comments or whitespace. All five standard actions retain case-insensitive interpretation. Unknown actions, quoted values, malformed comments and competing tokens still produce UNKNOWN, and duplicate-field handling and original report content keep their existing behavior.
Delivered on the unreleased
codex/10.0.0branch in dd7026c9, with the matching website guidance in c8838b54. ADR 0035 records the clarification under the existing source-fact boundary in ADR 0008. No public API or configuration changed.docs(converter): explain report read failure boundaries (#763, #961)
test(website): align report recovery guidance assertions (#763, #961)
docs(architecture): clarify lock and report failure boundaries (#488, #…
docs(api): align daemon and report failure guidance (#488, #763, #961)
fix(converter): retain report interruption and source evidence (#763, #…
docs(website): align daemon and report failure guides (#488, #763, #961)
docs(website): retain report capture expectations (#763, #961)
bbottema commentedon Nov 6, 2026
This follow-up is implemented on the unreleased 10.0.0 development branch. Acquiring, reading or closing the optional delivery-status stream now keeps typed interruption outside best-effort recovery, including interrupted causes and suppressed cleanup failures when the thread's interrupt flag is clear. The caller's thread state stays unchanged.
Ordinary I/O failures and socket timeouts still retain completed report blocks and an incomplete-extraction warning. An unfinished recipient block does not become a complete fact, and unrelated application failures keep their exception behavior.
The implementation is in 9c7d5df, with the usage guidance in d900443. The behavior follows ADR 0035, ADR 0036 and ADR 0041.
docs(journal): update SJM 10 release stories (#699, #704, #763, #961)