Skip to content

Reject DKIM configurations that exclude the From header #679

Description

@bbottema

Summary

Simple Java Mail currently accepts a DKIM header-exclusion setting that lists From. The underlying signer keeps From mandatory and silently ignores that exclusion, so the configuration is misleading rather than effective.

The public DKIM examples made the problem worse: the primary Java example and its property equivalent included From, and enabled the body-length (l=) parameter even though the runtime default is safely false.

Expected behavior

  • Reject a case-insensitive From header exclusion with a clear configuration error.
  • Preserve the existing safe runtime defaults: no exclusions, l= disabled, relaxed canonicalization, and RSA-SHA256.
  • Keep other exclusions and l=true available for explicit interoperability exceptions, with clear documentation of their trade-offs.
  • Correct Java, property, Spring-alias, configuration-reference, and migration guidance.

Compatibility impact

Applications that list From among exclusions now fail configuration or message construction instead of silently continuing with From still signed. No valid DKIM signing behavior is removed.

Historical context

  • #344 introduced header exclusions for relays that rewrite fields such as Message-ID and Date; its discussion identifies From as mandatory.
  • #499 exposed finer-grained DKIM configuration and changed the l= default to false in 8.8.0. Its From example was documentation, not a stated interoperability requirement.
  • RFC 6376 §5.4 requires the From header field to be signed.

Acceptance criteria

  • From is rejected case-insensitively in every DKIM configuration path.
  • Valid non-From exclusions remain supported.
  • The normal Java and properties examples use the safe defaults.
  • l=true appears only in a clearly labelled advanced exception with its integrity consequence first.
  • Documentation explains that exclusions are provider-specific and From must remain signed.
  • Migration and release material cover the compatibility change.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions