Skip to content

CLI cannot combine TO, CC, and BCC recipients after recipient API cleanup #682

Closed

Description

@bbottema

Problem

The recipient API cleanup in commit 66345568 removed the dedicated to(...), cc(...), and bcc(...) builder methods. The string-based withRecipients(name, fixedName, recipientType, addresses...) overload was deliberately retained for CLI and property-backed use.

The generated CLI now exposes only --email:withRecipients. A single occurrence works, but multiple occurrences are combined by picocli into one flat value list. CliCommandLineConsumer then treats that list as one method invocation and rejects it because the method accepts at most four arguments.

For example, combining TO, CC, and BCC currently fails with:

provided 12 arguments for '--email:withRecipients', but need at most 4

This means one CLI command cannot add more than one recipient type. The regression was introduced in 9.0.0 and is present through 9.1.6.

Intended correction

Restore readable CLI-only --email:to, --email:cc, and --email:bcc options without reintroducing the removed overload forest into the public Java builder API.

Acceptance criteria

  • sjm send and sjm validate accept TO, CC, and BCC recipients in the same command.
  • The aliases remain CLI-specific and do not expand the public Java builder API.
  • A process-level smoke test covers all three recipient types together.
  • The published CLI example uses the supported options.
  • Affected release notes and milestones carry a restrained compatibility notice until users can upgrade to the fixed release.

Activity

  1. self-assigned this
    on Aug 6, 2026
  2. added this to the v9.1.7 milestone on Aug 6, 2026
  3. bbottema commented on Aug 6, 2026

    @bbottema
    OwnerAuthor

    Implemented the correction by restoring --email:to, --email:cc, and --email:bcc through an internal CLI-only facade. The public EmailPopulatingBuilder stays unchanged, while the generated CLI metadata once again treats TO, CC, and BCC as independent options that can be combined in one command.

  4. bbottema commented on Aug 6, 2026

    @bbottema
    OwnerAuthor

    The implementation and compatibility-notice work are complete. Closing this as resolved for the v9.1.7 milestone.

  5. bbottema commented on Aug 6, 2026

    @bbottema
    OwnerAuthor

    The correction is now available in Simple Java Mail 9.1.7. CLI commands can again combine the independent --email:to, --email:cc, and --email:bcc options.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions