This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.22.x by this push:
     new 03f1d8b24c6f [backport camel-4.22.x] CAMEL-25534: camel-mail - the 
subject option says the header is ignored unless useHeaderSubject=true (#27813) 
(#27838)
03f1d8b24c6f is described below

commit 03f1d8b24c6f4178f410e45ef9dd7ecc017b84fa
Author: Federico Mariani <[email protected]>
AuthorDate: Wed Oct 14 21:20:33 2026 +0200

    [backport camel-4.22.x] CAMEL-25534: camel-mail - the subject option says 
the header is ignored unless useHeaderSubject=true (#27813) (#27838)
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 .../org/apache/camel/catalog/components/imap.json  |   4 +-
 .../org/apache/camel/catalog/components/imaps.json |   4 +-
 .../org/apache/camel/catalog/components/pop3.json  |   4 +-
 .../org/apache/camel/catalog/components/pop3s.json |   4 +-
 .../org/apache/camel/catalog/components/smtp.json  |   4 +-
 .../org/apache/camel/catalog/components/smtps.json |   4 +-
 .../apache/camel/catalog/docs/mail-component.adoc  | 101 +++++++++++++--------
 .../org/apache/camel/component/mail/imap.json      |   4 +-
 .../org/apache/camel/component/mail/imaps.json     |   4 +-
 .../org/apache/camel/component/mail/pop3.json      |   4 +-
 .../org/apache/camel/component/mail/pop3s.json     |   4 +-
 .../org/apache/camel/component/mail/smtp.json      |   4 +-
 .../org/apache/camel/component/mail/smtps.json     |   4 +-
 .../camel-mail/src/main/docs/mail-component.adoc   | 101 +++++++++++++--------
 .../apache/camel/component/mail/MailBinding.java   |   8 +-
 .../camel/component/mail/MailConfiguration.java    |   3 +-
 .../component/dsl/ImapComponentBuilderFactory.java |   5 +-
 .../dsl/ImapsComponentBuilderFactory.java          |   5 +-
 .../component/dsl/Pop3ComponentBuilderFactory.java |   5 +-
 .../dsl/Pop3sComponentBuilderFactory.java          |   5 +-
 .../component/dsl/SmtpComponentBuilderFactory.java |   5 +-
 .../dsl/SmtpsComponentBuilderFactory.java          |   5 +-
 .../endpoint/dsl/MailEndpointBuilderFactory.java   |   5 +-
 23 files changed, 179 insertions(+), 117 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imap.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imap.json
index 774b50238edf..f80c552e3ba1 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imap.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imap.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imaps.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imaps.json
index 9b27e7a084ff..929e147c5ae1 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imaps.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/imaps.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3.json
index 0153764fda41..e8fcaacb035c 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3s.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3s.json
index ac00144ddc56..925c51929949 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3s.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pop3s.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtp.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtp.json
index 35a59491c3b5..29890d71adaf 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtp.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtp.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtps.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtps.json
index 7415be8cb0ee..ee2f58beddde 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtps.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smtps.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mail-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mail-component.adoc
index d6b1182658cb..97ecd322afd8 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mail-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mail-component.adoc
@@ -197,8 +197,10 @@ headers.
 
 The subject of the
 
http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage]
-can be configured using a header property on the IN message. The code
-below demonstrates this:
+can be configured using a header property on the IN message. The `Subject`
+header is only used when the `useHeaderSubject=true` option is enabled on the
+endpoint (default `false`); otherwise the header is ignored and the `subject`
+endpoint option is used. The code below demonstrates this:
 
 [tabs]
 ====
@@ -206,7 +208,7 @@ Java::
 +
 [source,java]
 ----
-from("direct:a").setHeader("subject", 
constant(subject)).to("smtp://james2@localhost");
+from("direct:a").setHeader("subject", 
constant(subject)).to("smtp://james2@localhost?useHeaderSubject=true");
 ----
 
 XML::
@@ -218,7 +220,7 @@ XML::
   <setHeader name="subject">
     <constant>some subject</constant>
   </setHeader>
-  <to uri="smtp://james2@localhost"/>
+  <to uri="smtp://james2@localhost?useHeaderSubject=true"/>
 </route>
 ----
 
@@ -232,14 +234,21 @@ YAML::
       steps:
         - setHeader:
             name: subject
-            constant: "some subject"
+            expression:
+              constant:
+                expression: "some subject"
         - to:
             uri: smtp://james2@localhost
+            parameters:
+              useHeaderSubject: true
 ----
 ====
 
 The same applies for other MimeMessage headers such as recipients, so
-you can use a header property as `To`:
+you can use a header property as `To`. The `To`/`CC`/`BCC`, `From` and 
`Subject`
+headers are only honoured when `useHeaderRecipients=true`, `useHeaderFrom=true`
+and `useHeaderSubject=true` respectively are enabled on the endpoint (all 
default
+to `false`, see the `useHeader*` options table below):
 
 ._Java-only: ProducerTemplate API with mail headers_
 [source,java]
@@ -252,7 +261,8 @@ headers.put("CamelFileName", "fileOne");
 headers.put("org.apache.camel.test", "value");
 
 String body = "Hello Claus.\nYes it does.\n\nRegards James.";
-template.sendBodyAndHeaders("smtp://[email protected]", body, headers);
+template.sendBodyAndHeaders("smtp://[email protected]?useHeaderRecipients=true&useHeaderFrom=true&useHeaderSubject=true",
+        body, headers);
 ----
 
 When using the MailProducer to send the mail to
@@ -260,17 +270,23 @@ server, you should be able to get the message id of the
 
http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage]
 with the key `CamelMailMessageId` from the Camel message header.
 
-=== Headers take precedence over pre-configured recipients
+=== Recipient headers and pre-configured recipients
+
+By default (`useHeaderRecipients=false`, the default since Camel 4.21) the
+`To`, `CC` and `BCC` message headers are ignored and the mail is sent to the
+recipients pre-configured in the endpoint URI.
 
-The recipients specified in the message headers always take precedence
-over recipients pre-configured in the endpoint URI. The idea is that if
-you provide any recipients in the message headers, that is what you get.
-The recipients pre-configured in the endpoint URI are treated as a
-fallback.
+When `useHeaderRecipients=true` is set, the recipients specified in the
+message headers take precedence over recipients pre-configured in the
+endpoint URI. The idea is that if you provide any recipients in the message
+headers, that is what you get. The recipients pre-configured in the endpoint
+URI are treated as a fallback.
 
-In the sample code below, the email message is sent to
-`[email protected]`, because it takes precedence over the
-pre-configured recipient, `[email protected]`. Any `CC` and `BCC`
+In the sample code below, the endpoint enables `useHeaderRecipients=true`, so
+the email message is sent to `[email protected]`, because it takes
+precedence over the pre-configured recipient, `[email protected]`. Without
+`useHeaderRecipients=true` the `to` header would be ignored and the mail sent
+to `[email protected]`. Any `CC` and `BCC`
 settings in the endpoint URI are also ignored, and those recipients will
 not receive any mail. The choice between headers and pre-configured
 settings is all or nothing: the mail component _either_ takes the
@@ -284,18 +300,14 @@ pre-configured settings.
 Map<String, Object> headers = new HashMap<String, Object>();
 headers.put("to", "[email protected]");
 
-template.sendBodyAndHeaders("smtp://admin@[email protected]", 
"Hello World", headers);
+template.sendBodyAndHeaders("smtp://admin@[email protected]&useHeaderRecipients=true",
 "Hello World", headers);
 ----
 
-==== Opting out of header overrides (trust-boundary hardening)
+==== Letting message headers override the endpoint configuration
 
-For routes where message headers originate from an untrusted source (for
-example messages bridged from an HTTP endpoint, a JMS queue, or a Kafka
-topic), allowing inbound headers to override recipients, sender, subject, 
-or reply-to addresses can enable an attacker to redirect mail, intercept 
-replies, forge the sender address, or inject arbitrary subjects. Four 
-opt-in `@UriParam` options let you lock the endpoint configuration so it 
-cannot be overridden by message headers:
+By default the recipients, sender, subject and reply-to address configured
+on the endpoint cannot be overridden by message headers. Four opt-in
+`@UriParam` options let a route allow message headers to override them:
 
 [options="header"]
 |===
@@ -306,9 +318,21 @@ cannot be overridden by message headers:
 | `useHeaderReplyTo`   | `false` | Message Reply-To header can override the 
endpoint URI replyTo.
 |===
 
-All four default to `false`. Set to `true` to let message headers override the 
endpoint configuration.
+All four default to `false` since Camel 4.21. Set an option to `true` to let
+the matching message headers override the endpoint configuration.
 
-Example:
+Only enable the options a route needs, and only when the headers come from a
+trusted source. For routes where message headers originate from an untrusted
+source (for example messages bridged from an HTTP endpoint, a JMS queue, or a
+Kafka topic), allowing inbound headers to override recipients, sender, subject,
+or reply-to addresses can enable an attacker to redirect mail, intercept
+replies, forge the sender address, or inject arbitrary subjects. If such 
headers
+may reach the mail endpoint, leave the options disabled or remove the headers
+before sending.
+
+In the example below the route computes the recipients and the subject itself,
+so it enables `useHeaderRecipients` and `useHeaderSubject`, while the sender 
and
+reply-to address stay fixed to the endpoint configuration:
 
 [tabs]
 ====
@@ -316,28 +340,31 @@ Java::
 +
 [source,java]
 ----
-.to("smtp://relay@[email protected]&[email protected]&useHeaderRecipients=false&useHeaderFrom=false&useHeaderReplyTo=false");
+.to("smtp://relay@[email protected]&[email protected]&useHeaderRecipients=true&useHeaderSubject=true");
 ----
 
 XML::
 +
 [source,xml]
 ----
-<to 
uri="smtp://relay@[email protected]&amp;[email protected]&amp;useHeaderRecipients=false&amp;useHeaderFrom=false&amp;useHeaderReplyTo=false"/>
+<to 
uri="smtp://relay@[email protected]&amp;[email protected]&amp;useHeaderRecipients=true&amp;useHeaderSubject=true"/>
 ----
 
 YAML::
 +
 [source,yaml]
 ----
-- to:
-    uri: smtp://relay@mailhost
-    parameters:
-      to: "[email protected]"
-      from: "[email protected]"
-      useHeaderRecipients: false
-      useHeaderFrom: false
-      useHeaderReplyTo: false
+- route:
+    from:
+      uri: direct:send
+      steps:
+        - to:
+            uri: smtp://relay@mailhost
+            parameters:
+              to: "[email protected]"
+              from: "[email protected]"
+              useHeaderRecipients: true
+              useHeaderSubject: true
 ----
 ====
 
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imap.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imap.json
index 774b50238edf..f80c552e3ba1 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imap.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imap.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imaps.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imaps.json
index 9b27e7a084ff..929e147c5ae1 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imaps.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/imaps.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3.json
index 0153764fda41..e8fcaacb035c 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3s.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3s.json
index ac00144ddc56..925c51929949 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3s.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/pop3s.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtp.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtp.json
index 35a59491c3b5..29890d71adaf 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtp.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtp.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtps.json
 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtps.json
index 7415be8cb0ee..ee2f58beddde 100644
--- 
a/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtps.json
+++ 
b/components/camel-mail/src/generated/resources/META-INF/org/apache/camel/component/mail/smtps.json
@@ -49,7 +49,7 @@
     "from": { "index": 20, "kind": "property", "displayName": "From", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "lazyStartProducer": { "index": 21, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fai [...]
     "replyTo": { "index": 22, "kind": "property", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email address [...]
-    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes precedenc [...]
+    "subject": { "index": 23, "kind": "property", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeaderS [...]
     "to": { "index": 24, "kind": "property", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 25, "kind": "property", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpoi [...]
     "useHeaderRecipients": { "index": 26, "kind": "property", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configur [...]
@@ -126,7 +126,7 @@
     "cc": { "index": 28, "kind": "parameter", "displayName": "Cc", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the CC email address. Separate multiple 
email addresses with comma." },
     "from": { "index": 29, "kind": "parameter", "displayName": "From", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "camel@localhost", "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The from email address" },
     "replyTo": { "index": 30, "kind": "parameter", "displayName": "Reply To", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Reply-To recipients (the receivers of the 
response mail). Separate multiple email addres [...]
-    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. Note: 
Setting the subject in the header takes preceden [...]
+    "subject": { "index": 31, "kind": "parameter", "displayName": "Subject", 
"group": "producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "The Subject of the message being sent. The 
Subject message header is ignored unless useHeader [...]
     "to": { "index": 32, "kind": "parameter", "displayName": "To", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Sets the destination email address. Separate 
multiple email addresses with comma." },
     "useHeaderFrom": { "index": 33, "kind": "parameter", "displayName": "Use 
Header From", "group": "producer", "label": "producer", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.mail.MailConfiguration", "configurationField": 
"configuration", "description": "Whether message headers From and Sender 
override the sender pre-configured in the endpo [...]
     "useHeaderRecipients": { "index": 34, "kind": "parameter", "displayName": 
"Use Header Recipients", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.mail.MailConfiguration", 
"configurationField": "configuration", "description": "Whether message headers 
To, CC, and BCC override the recipients pre-configu [...]
diff --git a/components/camel-mail/src/main/docs/mail-component.adoc 
b/components/camel-mail/src/main/docs/mail-component.adoc
index d6b1182658cb..97ecd322afd8 100644
--- a/components/camel-mail/src/main/docs/mail-component.adoc
+++ b/components/camel-mail/src/main/docs/mail-component.adoc
@@ -197,8 +197,10 @@ headers.
 
 The subject of the
 
http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage]
-can be configured using a header property on the IN message. The code
-below demonstrates this:
+can be configured using a header property on the IN message. The `Subject`
+header is only used when the `useHeaderSubject=true` option is enabled on the
+endpoint (default `false`); otherwise the header is ignored and the `subject`
+endpoint option is used. The code below demonstrates this:
 
 [tabs]
 ====
@@ -206,7 +208,7 @@ Java::
 +
 [source,java]
 ----
-from("direct:a").setHeader("subject", 
constant(subject)).to("smtp://james2@localhost");
+from("direct:a").setHeader("subject", 
constant(subject)).to("smtp://james2@localhost?useHeaderSubject=true");
 ----
 
 XML::
@@ -218,7 +220,7 @@ XML::
   <setHeader name="subject">
     <constant>some subject</constant>
   </setHeader>
-  <to uri="smtp://james2@localhost"/>
+  <to uri="smtp://james2@localhost?useHeaderSubject=true"/>
 </route>
 ----
 
@@ -232,14 +234,21 @@ YAML::
       steps:
         - setHeader:
             name: subject
-            constant: "some subject"
+            expression:
+              constant:
+                expression: "some subject"
         - to:
             uri: smtp://james2@localhost
+            parameters:
+              useHeaderSubject: true
 ----
 ====
 
 The same applies for other MimeMessage headers such as recipients, so
-you can use a header property as `To`:
+you can use a header property as `To`. The `To`/`CC`/`BCC`, `From` and 
`Subject`
+headers are only honoured when `useHeaderRecipients=true`, `useHeaderFrom=true`
+and `useHeaderSubject=true` respectively are enabled on the endpoint (all 
default
+to `false`, see the `useHeader*` options table below):
 
 ._Java-only: ProducerTemplate API with mail headers_
 [source,java]
@@ -252,7 +261,8 @@ headers.put("CamelFileName", "fileOne");
 headers.put("org.apache.camel.test", "value");
 
 String body = "Hello Claus.\nYes it does.\n\nRegards James.";
-template.sendBodyAndHeaders("smtp://[email protected]", body, headers);
+template.sendBodyAndHeaders("smtp://[email protected]?useHeaderRecipients=true&useHeaderFrom=true&useHeaderSubject=true",
+        body, headers);
 ----
 
 When using the MailProducer to send the mail to
@@ -260,17 +270,23 @@ server, you should be able to get the message id of the
 
http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage]
 with the key `CamelMailMessageId` from the Camel message header.
 
-=== Headers take precedence over pre-configured recipients
+=== Recipient headers and pre-configured recipients
+
+By default (`useHeaderRecipients=false`, the default since Camel 4.21) the
+`To`, `CC` and `BCC` message headers are ignored and the mail is sent to the
+recipients pre-configured in the endpoint URI.
 
-The recipients specified in the message headers always take precedence
-over recipients pre-configured in the endpoint URI. The idea is that if
-you provide any recipients in the message headers, that is what you get.
-The recipients pre-configured in the endpoint URI are treated as a
-fallback.
+When `useHeaderRecipients=true` is set, the recipients specified in the
+message headers take precedence over recipients pre-configured in the
+endpoint URI. The idea is that if you provide any recipients in the message
+headers, that is what you get. The recipients pre-configured in the endpoint
+URI are treated as a fallback.
 
-In the sample code below, the email message is sent to
-`[email protected]`, because it takes precedence over the
-pre-configured recipient, `[email protected]`. Any `CC` and `BCC`
+In the sample code below, the endpoint enables `useHeaderRecipients=true`, so
+the email message is sent to `[email protected]`, because it takes
+precedence over the pre-configured recipient, `[email protected]`. Without
+`useHeaderRecipients=true` the `to` header would be ignored and the mail sent
+to `[email protected]`. Any `CC` and `BCC`
 settings in the endpoint URI are also ignored, and those recipients will
 not receive any mail. The choice between headers and pre-configured
 settings is all or nothing: the mail component _either_ takes the
@@ -284,18 +300,14 @@ pre-configured settings.
 Map<String, Object> headers = new HashMap<String, Object>();
 headers.put("to", "[email protected]");
 
-template.sendBodyAndHeaders("smtp://admin@[email protected]", 
"Hello World", headers);
+template.sendBodyAndHeaders("smtp://admin@[email protected]&useHeaderRecipients=true",
 "Hello World", headers);
 ----
 
-==== Opting out of header overrides (trust-boundary hardening)
+==== Letting message headers override the endpoint configuration
 
-For routes where message headers originate from an untrusted source (for
-example messages bridged from an HTTP endpoint, a JMS queue, or a Kafka
-topic), allowing inbound headers to override recipients, sender, subject, 
-or reply-to addresses can enable an attacker to redirect mail, intercept 
-replies, forge the sender address, or inject arbitrary subjects. Four 
-opt-in `@UriParam` options let you lock the endpoint configuration so it 
-cannot be overridden by message headers:
+By default the recipients, sender, subject and reply-to address configured
+on the endpoint cannot be overridden by message headers. Four opt-in
+`@UriParam` options let a route allow message headers to override them:
 
 [options="header"]
 |===
@@ -306,9 +318,21 @@ cannot be overridden by message headers:
 | `useHeaderReplyTo`   | `false` | Message Reply-To header can override the 
endpoint URI replyTo.
 |===
 
-All four default to `false`. Set to `true` to let message headers override the 
endpoint configuration.
+All four default to `false` since Camel 4.21. Set an option to `true` to let
+the matching message headers override the endpoint configuration.
 
-Example:
+Only enable the options a route needs, and only when the headers come from a
+trusted source. For routes where message headers originate from an untrusted
+source (for example messages bridged from an HTTP endpoint, a JMS queue, or a
+Kafka topic), allowing inbound headers to override recipients, sender, subject,
+or reply-to addresses can enable an attacker to redirect mail, intercept
+replies, forge the sender address, or inject arbitrary subjects. If such 
headers
+may reach the mail endpoint, leave the options disabled or remove the headers
+before sending.
+
+In the example below the route computes the recipients and the subject itself,
+so it enables `useHeaderRecipients` and `useHeaderSubject`, while the sender 
and
+reply-to address stay fixed to the endpoint configuration:
 
 [tabs]
 ====
@@ -316,28 +340,31 @@ Java::
 +
 [source,java]
 ----
-.to("smtp://relay@[email protected]&[email protected]&useHeaderRecipients=false&useHeaderFrom=false&useHeaderReplyTo=false");
+.to("smtp://relay@[email protected]&[email protected]&useHeaderRecipients=true&useHeaderSubject=true");
 ----
 
 XML::
 +
 [source,xml]
 ----
-<to 
uri="smtp://relay@[email protected]&amp;[email protected]&amp;useHeaderRecipients=false&amp;useHeaderFrom=false&amp;useHeaderReplyTo=false"/>
+<to 
uri="smtp://relay@[email protected]&amp;[email protected]&amp;useHeaderRecipients=true&amp;useHeaderSubject=true"/>
 ----
 
 YAML::
 +
 [source,yaml]
 ----
-- to:
-    uri: smtp://relay@mailhost
-    parameters:
-      to: "[email protected]"
-      from: "[email protected]"
-      useHeaderRecipients: false
-      useHeaderFrom: false
-      useHeaderReplyTo: false
+- route:
+    from:
+      uri: direct:send
+      steps:
+        - to:
+            uri: smtp://relay@mailhost
+            parameters:
+              to: "[email protected]"
+              from: "[email protected]"
+              useHeaderRecipients: true
+              useHeaderSubject: true
 ----
 ====
 
diff --git 
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
 
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
index 708f6427a494..4c792baf47dd 100644
--- 
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
+++ 
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
@@ -147,8 +147,8 @@ public class MailBinding {
             setRecipientFromEndpointConfiguration(mimeMessage, endpoint, 
exchange);
         }
 
-        // set the replyTo if it was passed in as an option in the uri. Note: 
if it is in both the URI
-        // and headers, the headers win UNLESS useHeaderReplyTo is set to 
false.
+        // set the replyTo if it was passed in as an option in the uri. Note: 
the Reply-To header is
+        // ignored unless useHeaderReplyTo is set to true (default false), in 
which case the header wins.
         String replyTo = null;
         if (endpoint.getConfiguration().isUseHeaderReplyTo()) {
             replyTo = exchange.getIn().getHeader(MailConstants.MAIL_REPLY_TO, 
String.class);
@@ -172,8 +172,8 @@ public class MailBinding {
             throw new IllegalArgumentException("The mail message does not have 
any recipients set.");
         }
 
-        // set the subject if it was passed in as an option in the uri. Note: 
if it is in both the URI
-        // and headers the headers win UNLESS useHeaderSubject is set to false.
+        // set the subject if it was passed in as an option in the uri. Note: 
the Subject header is
+        // ignored unless useHeaderSubject is set to true (default false), in 
which case the header wins.
         String subject = endpoint.getConfiguration().getSubject();
         if (subject != null) {
             mimeMessage.setSubject(subject, 
ExchangeHelper.getCharsetName(exchange, false));
diff --git 
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
 
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
index 3982108d2090..a0e0b1315cc6 100644
--- 
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
+++ 
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
@@ -451,7 +451,8 @@ public class MailConfiguration implements Cloneable {
     }
 
     /**
-     * The Subject of the message being sent. Note: Setting the subject in the 
header takes precedence over this option.
+     * The Subject of the message being sent. The Subject message header is 
ignored unless useHeaderSubject=true, in
+     * which case it overrides this option.
      */
     public void setSubject(String subject) {
         this.subject = subject;
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
index f2e0a3053465..28fe0032c92e 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface ImapComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
index d6551a099fc2..568dd6e40a50 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface ImapsComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
index fccab2187312..bd64da98337f 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface Pop3ComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
index fd56d223507b..85f17284caef 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface Pop3sComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
index f86031d4f7f5..78e7079417ad 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface SmtpComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
index 44f9c34b8d1f..09583a8604b3 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
@@ -502,8 +502,9 @@ public interface SmtpsComponentBuilderFactory {
         }
     
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
index 21efb24db774..1ccd2f9fed0a 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
@@ -2112,8 +2112,9 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The Subject of the message being sent. Note: Setting the subject in
-         * the header takes precedence over this option.
+         * The Subject of the message being sent. The Subject message header is
+         * ignored unless useHeaderSubject=true, in which case it overrides 
this
+         * option.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 

Reply via email to