Skip to content

[backport camel-4.18.x] CAMEL-23591: camel-mail - align consumer-side dispatch header constant names with Camel naming convention#23536

Merged
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23478-to-camel-4.18.x
May 27, 2026
Merged

[backport camel-4.18.x] CAMEL-23591: camel-mail - align consumer-side dispatch header constant names with Camel naming convention#23536
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23478-to-camel-4.18.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 26, 2026

Backports #23478 to camel-4.18.x.

Cherry-pick of merge commit a04605ea8b8 with one adaptation: the original
PR's upgrade-guide entry was added to camel-4x-upgrade-guide-4_21.adoc,
which does not exist on the 4.18.x maintenance branch. Per the project's
backport policy the same content has been added to
camel-4x-upgrade-guide-4_18.adoc instead (as a new
=== camel-mail - potential breaking change section, separate from and
following the existing === camel-mail section that was added by CAMEL-23522
for the mail.smtp.* JavaMail session-property hardening).

Summary

Renames the three consumer-side dispatch header string values in
MailConstants that control post-processing of a consumed mail message
(copyTo, moveTo, delete) to CamelMail<Name>. These sat outside the
Camel namespace and were therefore not filtered by the default
HeaderFilterStrategy.

Constant Previous value New value
MailConstants.MAIL_COPY_TO copyTo CamelMailCopyTo
MailConstants.MAIL_MOVE_TO moveTo CamelMailMoveTo
MailConstants.MAIL_DELETE delete CamelMailDelete

Intentionally left unchanged

  • RFC 5322 message headers (MAIL_SUBJECT=Subject, MAIL_FROM=From,
    MAIL_TO=To, MAIL_CC=Cc, MAIL_BCC=Bcc, MAIL_REPLY_TO=Reply-To,
    MAIL_CONTENT_TYPE=contentType) map directly to email fields; renaming
    would break mail interoperability.
  • The equally-named copyTo / moveTo endpoint URI options on the mail
    consumer are config properties, distinct from the Exchange headers, and are
    unchanged.

DSL accessor renames: copyTo()mailCopyTo(),
moveTo()mailMoveTo(), delete()mailDelete().

Test plan

  • mvn test in components/camel-mail on the 4.18.x branch — 218 tests
    pass (4 skipped)
  • Cherry-pick applied cleanly except for the 4_21 → 4_18 guide-file
    rename described above
  • Upgrade-guide entry added under
    === camel-mail - potential breaking change in
    camel-4x-upgrade-guide-4_18.adoc, distinct from the existing
    CAMEL-23522 === camel-mail section

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean backport of the camel-mail header rename to 4.18.x — copyToCamelMailCopyTo, moveToCamelMailMoveTo, deleteCamelMailDelete. Consistent with the ongoing header-naming convention work on main. Upgrade guide entry properly included for the 4.18 line.

LGTM.

Fully automatic review from Claude Code

@oscerd oscerd force-pushed the backport/23478-to-camel-4.18.x branch 2 times, most recently from 596901f to 830929d Compare May 27, 2026 08:09
…t names with Camel naming convention (apache#23478)

Renames the three consumer-side dispatch header string values in MailConstants
that control post-processing of a consumed mail message (copyTo, moveTo,
delete) to CamelMail<Name>, following the convention used across the rest of
the Camel component catalog and matching the pattern established in CAMEL-23526
(camel-cxf), CAMEL-23522 (camel-mail mail.smtp.* hardening, of which this is
the companion), CAMEL-23461 (camel-aws-bedrock), CAMEL-23532
(camel-vertx-websocket / camel-atmosphere-websocket / camel-iggy), and
CAMEL-23576 (camel-jira).

- MAIL_COPY_TO: "copyTo" -> "CamelMailCopyTo"
- MAIL_MOVE_TO: "moveTo" -> "CamelMailMoveTo"
- MAIL_DELETE: "delete" -> "CamelMailDelete"

The Java field names are unchanged so routes referencing the constants
symbolically continue to work; routes using the literal string values must be
updated (documented in the 4.21 upgrade guide).

The standard RFC 5322 message header constants (MAIL_SUBJECT=Subject,
MAIL_FROM=From, MAIL_TO=To, MAIL_CC=Cc, MAIL_BCC=Bcc, MAIL_REPLY_TO=Reply-To,
MAIL_CONTENT_TYPE=contentType) are intentionally unchanged, as they map
directly to the corresponding email fields and renaming them would break mail
interoperability. The equally-named copyTo and moveTo endpoint URI options on
the mail consumer are also unchanged; only the Exchange header values are
affected.

The generated Endpoint DSL header accessors on MailHeaderNameBuilder have been
renamed: copyTo() -> mailCopyTo(), moveTo() -> mailMoveTo(), and delete() ->
mailDelete().

All existing tests pass (they use symbolic constant references or the
unchanged URI options).

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd force-pushed the backport/23478-to-camel-4.18.x branch from 830929d to 64d8d51 Compare May 27, 2026 08:22
@oscerd oscerd merged commit ccffe52 into apache:camel-4.18.x May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants