Skip to content

Keep a missing Outlook sender absent on imported Email #975

Closed

Description

@bbottema

Outlook MSG import currently supplies a From address even when the source has none. This comes from #201's deliberate fallback, which is present in released 9.3.9, but it makes a missing sender look like received source information.

Email received = mail.converter()
    .fromOutlookMsg(Path.of("unsent draft.msg"))
    .toEmail();

received.getFromRecipient().getAddress();
// "donotreply@unknown-from-address.net", although no source address exists

On 8 November 2026 the maintainer accepted retiring this fallback for 10.0.0. When the Outlook reader has no sender address, leave Email.getFromRecipient() null and retain the available sender name and other native source metadata through the existing inspection view. Keep actual sender interpretation, readable bodies, attachments, protection results, copying and serialization.

A newly composed outgoing message still needs a From address. Applications can set one on a copy. MSG imports keep their existing choice to ignore defaults; an application that wants the selected Mailer's Email defaults to supply From must deliberately restore default participation on that copy. Overrides retain their ordinary authority. Ordinary outgoing validation should continue to reject an unresolved missing sender.

This intentionally changes #201's released behavior. The 10.0.0 migration guide must explain the nullable sender and the supported ways to supply an outgoing From address. Do not substitute an Outlook last-modifier identity, guess another mailbox, add a new recovery setting, or treat an absent optional sender as an import failure.

The decision follows ADR 0035 and ADR 0041, and supersedes #201's dummy-address policy for 10.0.0. Related history: #414 and #645.

Activity

  1. added this to the 10.0.0 milestone on Nov 8, 2026
  2. bbottema commented on Nov 8, 2026

    @bbottema
    OwnerAuthor
    Email received = mail.converter().fromOutlookMsg(msgPath).toEmail();
    Recipient sender = received.getFromRecipient(); // null when the source has no sender address
    
    Email outgoing = mail.emailBuilder().copying(received)
        .from("Archive", "archive@example.org")
        .buildEmail();

    MSG import now leaves a missing sender absent. Available native names and other source metadata remain inspectable through getSourceData(), and a last-modifier identity does not become From. Actual senders and readable message content keep their existing interpretation.

    To use a Mailer's Email defaults instead, deliberately restore default participation on a copy before completing or sending it:

    EmailPopulatingBuilder draft = mail.emailBuilder().copying(received);
    Email usingDefaults = draft.withTemplateOptions(draft.getTemplateOptions().toBuilder()
            .resetIgnoreDefaults().build())
        .buildEmail();
    // The selected Mailer's withEmailDefaults(...) can now supply From.

    Ordinary validation still requires an outgoing From address. This intentionally supersedes #201's dummy-address fallback; imported messages otherwise keep their existing template choices.

    Implemented on codex/10.0.0 for the unreleased 10.0.0 line in 2ca74d6ce. The migration guidance is recorded in website commits 8167755 and c43ad0c. ADR 0041 records the decision and its relationship to ADR 0035.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions