Skip to content

Keep readable Outlook messages importable when date metadata is missing #974

Closed

Description

@bbottema

A readable Outlook MSG can fail to import because an optional creation, modification or source date is absent. Simple Java Mail 9.3.9 reads these values through outlook-message-parser 1.16.2, whose date getters clone null fields. The preferred sent-date expression also evaluates its fallback even when client-submit time is available.

// The message has readable content but no last-modification timestamp.
Email email = mail.converter()
    .fromOutlookMsg(Path.of("message.msg"))
    .toEmail();

Keep the readable body, recipients, attachments and source metadata available. Missing dates should remain absent, and client-submit time should remain the first sent-date choice. Select the existing source-date fallback only when needed, and fix the Email date only when a date is available. Do not fabricate timestamps or catch arbitrary NullPointerExceptions.

The null-safe getters belong in outlook-message-parser; Simple Java Mail should consume that correction and preserve the existing Date snapshot ownership. This follows ADR 0035, ADR 0036 and ADR 0041.

The maintainer accepted this correction on 8 November 2026 for the 10.0.0 development branch. It is separate from #326's historical handling of completely empty nested Outlook messages and from missing client-submit extraction in outlook-message-parser#87.

Upstream correction: outlook-message-parser#103.

Activity

  1. added this to the 10.0.0 milestone on Nov 8, 2026
  2. moved this from Todo to In Progress in Simple Java Mail 10.0.0on Nov 8, 2026
  3. bbottema commented on Nov 8, 2026

    @bbottema
    OwnerAuthor
    OutlookEmailConversionResult converted = mail.converter()
        .fromOutlookMsg(Path.of("message.msg"))
        .toEmailBuilderWithOutlookData();
    Email email = converted.buildEmail();
    Date sentAt = email.getSentDate();
    Date modifiedAt = converted.getOutlookMessageData().getLastModificationDate();

    Missing date metadata now stays absent while readable bodies, recipients, attachments and source information remain available. The Email sent date still prefers client-submit time, then the existing Outlook source-date fallback; it stays unfixed when neither exists. Present Date values remain defensive copies.

    Delivered for the 10.0.0 development branch in the date-handling change and the parser dependency update, with conversion and migration guidance. The null-safe reader is available in outlook-message-parser 1.16.3.

    This follows ADR 0035, ADR 0036 and ADR 0041.

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