This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-26018-mail-alternative-body-header in repository https://gitbox.apache.org/repos/asf/camel.git
commit 31536c46b707d054cfec326c368fd191b9d9ae40 Author: Claus Ibsen <[email protected]> AuthorDate: Thu Oct 22 18:39:40 2026 +0200 CAMEL-26018: camel-mail - list the CamelMailAlternativeBody header in the catalog The smtp producer reads the alternative body of an HTML mail from the CamelMailAlternativeBody header, but the header had no @Metadata, so the catalog did not list it, and the YAML validator of Camel CLI rejected a route that sets it ("header CamelMailAlternativeBody is not set by timer, smtp"). The endpoint DSL now has mailAlternativeBody() as well. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/catalog/components/imap.json | 3 ++- .../org/apache/camel/catalog/components/imaps.json | 3 ++- .../org/apache/camel/catalog/components/pop3.json | 3 ++- .../org/apache/camel/catalog/components/pop3s.json | 3 ++- .../org/apache/camel/catalog/components/smtp.json | 3 ++- .../org/apache/camel/catalog/components/smtps.json | 3 ++- .../META-INF/org/apache/camel/component/mail/imap.json | 3 ++- .../org/apache/camel/component/mail/imaps.json | 3 ++- .../META-INF/org/apache/camel/component/mail/pop3.json | 3 ++- .../org/apache/camel/component/mail/pop3s.json | 3 ++- .../META-INF/org/apache/camel/component/mail/smtp.json | 3 ++- .../org/apache/camel/component/mail/smtps.json | 3 ++- .../org/apache/camel/component/mail/MailConstants.java | 5 +++++ .../endpoint/dsl/MailEndpointBuilderFactory.java | 14 ++++++++++++++ .../core/commands/ai/SourceValidatorEndpointTest.java | 18 ++++++++++++++++++ 15 files changed, 61 insertions(+), 12 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 9b8988530357..51a58860ac53 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 f56002e98937..175304b676fe 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 9fb6eff1c729..6145a5b3d702 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 c11bad9b02d4..5c143e9677f4 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 d3f38498fd41..6bd9a0eb5355 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 b69d5f39ba6c..d287c4f28501 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 9b8988530357..51a58860ac53 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 f56002e98937..175304b676fe 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 9fb6eff1c729..6145a5b3d702 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 c11bad9b02d4..5c143e9677f4 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 d3f38498fd41..6bd9a0eb5355 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, 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 b69d5f39ba6c..d287c4f28501 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 @@ -93,7 +93,8 @@ "CamelMailCopyTo": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be copied to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_COPY_TO" }, "CamelMailMoveTo": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "After processing a mail message, it can be moved to a mail folder with the given name.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MOVE_TO" }, "CamelMailDelete": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deletes the messages after they have been processed.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_DELETE" }, - "CamelMailMessageId": { "index": 10, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } + "CamelMailAlternativeBody": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when the body is sent as text\/html. The alternativeBodyHeader option can change the name of this header.", "constantName": "org.apache.came [...] + "CamelMailMessageId": { "index": 11, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message ID.", "constantName": "org.apache.camel.component.mail.MailConstants#MAIL_MESSAGE_ID" } }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" }, diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java index df12ecaf9db4..9d64fd37c9e4 100644 --- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java +++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java @@ -44,6 +44,11 @@ public final class MailConstants { public static final String MAIL_MOVE_TO = "CamelMailMoveTo"; @Metadata(label = "consumer", description = "Deletes the messages after they have been processed.", javaType = "boolean") public static final String MAIL_DELETE = "CamelMailDelete"; + @Metadata(label = "producer", + description = "The alternative body of the mail, as plain text for mail clients that cannot show HTML, when" + + " the body is sent as text/html. The alternativeBodyHeader option can change the name of" + + " this header.", + javaType = "String") public static final String MAIL_ALTERNATIVE_BODY = "CamelMailAlternativeBody"; public static final String MAIL_DEFAULT_FOLDER = "INBOX"; public static final String MAIL_DEFAULT_FROM = "camel@localhost"; 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 e7c7e5b53320..e1912f6c3e5f 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 @@ -3884,6 +3884,20 @@ public interface MailEndpointBuilderFactory { public String mailDelete() { return "CamelMailDelete"; } + /** + * The alternative body of the mail, as plain text for mail clients that + * cannot show HTML, when the body is sent as text/html. The + * alternativeBodyHeader option can change the name of this header. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code MailAlternativeBody}. + */ + public String mailAlternativeBody() { + return "CamelMailAlternativeBody"; + } /** * The message ID. * diff --git a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorEndpointTest.java b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorEndpointTest.java index d3325f4a0527..735e2a09734c 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorEndpointTest.java +++ b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorEndpointTest.java @@ -607,6 +607,24 @@ class SourceValidatorEndpointTest { .doesNotContain("did you mean")); } + /** CAMEL-26018: the smtp producer reads the alternative body of an HTML mail from CamelMailAlternativeBody. */ + @Test + void aHeaderTheProducerReadsIsKnown() { + List<String> msgs = SourceValidator.validateKnownHeaders(""" + - from: + uri: timer:tick + steps: + - setHeader: + name: CamelMailAlternativeBody + constant: Hello plain text + - setBody: + constant: <p>Hello HTML</p> + - to: + uri: smtp://[email protected]&contentType=text/html + """, catalog); + assertThat(msgs).isEmpty(); + } + /** The JMS request-reply hint is for JMS only: the reply headers of other components keep their "did you mean". */ @Test void aReplyHeaderOfAnotherComponentGetsDidYouMean() {
