Repository navigation
Description
Step 8: Negotiate SMTP content per message, with explicit legacy-server support
- Status: Implemented, reviewed and accepted on 25 September 2026; code and website documentation are committed and pushed to the 10.0.0 development branches. Not yet released.
- Depends on: Step 4 capability reporting and the finalized-content contract from exact EML/rehearsal
- Child issue: #742, under #722
- Milestone: 10.0.0; classification:
enhancement, never alsomajor feature - Primary modules:
angus-mail-provider-module,simple-java-mail, configuration/Spring and generated CLI support
Goal and agreed correction
Do not mark ordinary ASCII-compatible email as requiring SMTPUTF8 just because its reusable transport can encode UTF-8. Select declarations per
submission without reconnecting, replacing pools, changing shared Session properties or rewriting protected content. Normal Unicode display names,
subjects and bodies retain their existing MIME encoding.
Missing advertisement does not establish that a server cannot accept the content. Legacy servers may accept unadvertised UTF-8 or 8-bit data, but
SMTP acceptance cannot establish that the delivery route will preserve it. Support those deployments through an explicit opt-in, not automatic fallback.
Public API and configuration
mailerBuilder.withLegacySmtpContentSupport(true);simplejavamail.smtp.legacycontentsupport=true- Default false; repeated builder calls replace the choice. Expose
OperationalConfig.isLegacySmtpContentSupportEnabled(). - Resolve the Boolean in the builder, inject it into operational configuration, and register visible
SMTP_CONNECTIONdiagnostics. - Include property files, Spring metadata and generated CLI help/options. The builder interface owns the contract; implementations link with
@see. - This is server compatibility, not Email/recipient policy, a new enum, an always-SMTPUTF8 mode, or permission to weaken transport security.
Submission behavior
| Actual submission | Default | Explicit legacy opt-in |
|---|---|---|
| ASCII-compatible envelope/content | No unnecessary SMTPUTF8 declaration | Same |
| Required capability advertised | Declare and use it | Same |
| SMTPUTF8 needed but not advertised | Reject before MAIL FROM | Attempt unchanged UTF-8 without automatically declaring SMTPUTF8 |
| 8BITMIME needed but not advertised | Reject before MAIL FROM | Attempt unchanged 8-bit content without automatically declaring BODY=8BITMIME |
- Determine requirements from actual envelope/content, not display names or an
8bitlabel whose transmitted body is ASCII. - Preserve existing capability-dependent Angus 8-bit conversion and deliberately supplied advanced provider extensions.
- Retain injection checks, well-formed UTF-8, binary/NUL/overlong-DATA restrictions and conflicting explicit BODY checks.
- Never substitute mailbox characters, strip accents or rewrite exact/DKIM/S/MIME/OpenPGP bytes. Never retry by weakening the requirements.
- Keep TLS, REQUIRETLS, explicit DSN requirements and internationalized ORCPT capability checks independent of the opt-in.
- Errors say that support is not advertised, explain the normal remedy, and offer the opt-in only for a verified legacy deployment.
Provider and pool ownership
- Keep owned managed Angus transports UTF-8-capable for their lifetime, while honoring explicit
mail.mime.allowutf8=false. - Apply the per-submission declaration through the existing managed command hook, preserving the sender path and unrelated parameters. Angus still
owns SMTP sequencing and command encoding. Never falsify the capabilities it reports. - Carry immutable choices on the existing Angus message facade; clear active submission state in
finallyunder the transport monitor. - Carry compatibility permission through
PreparedMail; existing constructors default to disabled. Resolve it from the actual selected Session's
configuration, following clustered-server ownership. Do not introduce another mutable Session policy property. - Install managed protocol handling for owned stock Angus Sessions independently of socket tracking. Preserve application socket factories;
unavailable abort support stays unavailable. Initialize UTF-8 before MIME/transports, including offline preparation. - Do not modify caller-owned Sessions, CustomMailer or third-party provider ownership. Ordinary caller-owned Angus retains its Session-wide declaration
behavior. The content opt-in does not override explicitly disabled UTF-8 encoding.
Verification and delivery
- Exact wire parameters/bytes for ASCII, internationalized addresses, raw UTF-8 headers and 8-bit bodies with neither/either/both advertisements and both policies.
- Tolerant and rejecting legacy peers; no altered-content retry and no claim of final delivery.
- Same-connection alternating and concurrent pooled sends, post-STARTTLS capabilities, replacements, mixed cluster policies, failures and cancellation.
- Simple batches/open connections, exact/protected bytes/signatures, quoting, explicit encoding/extensions, DSN and REQUIRETLS combinations.
- Configuration precedence/isolation, diagnostics, Spring metadata/compatibility, CLI help/execution, classpath/JPMS and provider ownership.
- Focused tests, real Java 11 library verification, modern-JDK non-live reactor, website checks/build/internal links; license cleanup and coding-guide audit.
- Feature/configuration/Spring/CLI guidance, release notes, architecture ownership and migration notes aligned.
- Production changes reviewed and accepted; implementation and website documentation are committed and pushed. Phase 4 and Track SMTP submission robustness improvements #722 remain open for the remaining steps.
Migration notes compare with released versions: previously working unadvertised submissions can require the explicit legacy setting. Do not describe
changes between intermediate unreleased implementations as migration work. Document one reused Mailer for international mail, probes as diagnostics,
and legacy fallback as an application decision about its verified server and onward route. Preserve unrelated staged research, documentation and Journal work.
Characterization and references
Angus 2.0.5 captures mail.mime.allowutf8 at transport construction, adds SMTPUTF8 whenever offered even for ASCII mail, and can encode UTF-8 commands
without that advertisement. Its existing optional 8-bit conversion needs a corresponding BODY declaration. These facts motivate a per-submission hook,
not a second pool or a mutable encoding mode.
Legacy fallback deliberately operates outside negotiated extension guarantees. Postfix documents legacy UTF-8 handling;
that is not a guarantee about every server or onward hop.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
bbottema commentedon Sep 17, 2026
The initial Angus 2.0.5 wire characterization is now executable in
SmtpContentNegotiationCharacterizationTest(13 passing loopback cases).Key findings so far:
mail.mime.allowutf8=trueaddsSMTPUTF8whenever advertised, even for fully ASCII mail.mail.smtp.allow8bitmime=trueconverts eligible composed text to 8-bit when advertised, but does not addBODY=8BITMIMEto MAIL FROM.These results reinforce that the solution must derive requirements per finalized message and envelope rather than expose Angus's two global switches. The next slice covers multipart content, internationalized domains versus local parts, protected content, and RFC 6533 DSN interaction before public API design.
[-]Make SMTPUTF8 and 8BITMIME negotiation explicit[/-][+]Guard SMTPUTF8 and 8BITMIME compatibility before submission[/+][-]Guard SMTPUTF8 and 8BITMIME compatibility before submission[/-][+]Negotiate SMTP content per message, with opt-in legacy server support[/+]docs(smtp): explain content negotiation and legacy compatibility
test(smtp): isolate protocol fixtures from hostname lookup (#742)
chore(test): remove generated license headers (#742)
feat(smtp): negotiate content and support legacy servers (#742)
test(smtp): cover content negotiation and configuration (#742)
docs(smtp): explain per-message content compatibility (#742)
bbottema commentedon Sep 25, 2026
Implemented for 10.0.0. Managed Angus connections now select SMTPUTF8/8BITMIME per email; ordinary Unicode subjects, display names and bodies keep their MIME encoding. For a verified legacy server and onward delivery route that accept unadvertised UTF-8/8-bit content, opt in with:
Or through configuration:
simplejavamail.smtp.legacycontentsupport=trueThe default remains false. This does not alter addresses or exact/signed content, relax TLS requirements, or guarantee final delivery.