This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit d3d5cad42d7d62fc356715462bce969f92668e1c Author: Claus Ibsen <[email protected]> AuthorDate: Sat Oct 24 20:26:15 2026 +0200 CAMEL-26018: camel-mail - list the CamelMailAlternativeBody header in the catalog (#28308) 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 | 6 ++++++ .../endpoint/dsl/MailEndpointBuilderFactory.java | 16 ++++++++++++++++ .../core/commands/ai/SourceValidatorEndpointTest.java | 18 ++++++++++++++++++ 15 files changed, 64 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 0546a307010a..855eccf7306c 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 db9fc6854eda..86cf10bfb0f5 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 ddc2eb7c76b9..97844e113985 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 291fa8bd7221..7f759b762329 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 830d658df0b5..e66b18385335 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 c40792891107..4be208895866 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 0546a307010a..855eccf7306c 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 db9fc6854eda..86cf10bfb0f5 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 ddc2eb7c76b9..97844e113985 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 291fa8bd7221..7f759b762329 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 830d658df0b5..e66b18385335 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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 c40792891107..4be208895866 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. When set, the mail is sent as multipart\/alternative with this text and the body (typically HTML) as its two parts, so mail clients that cannot show HTML show the text. The altern [...] + "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" } }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream", "pojo" ], "dependsOn": [ "binding" ], "byOption": [ { "option": "mapMailMessage", "value": "false", "carriers": [ "pojo" ], "javaType": "jakarta.mail.Message" } ], "description": "The content of the mail an imap or pop3 consumer reads: a String for text\/plain, text\/html and text\/xml, a stream for another content type, and a jakarta.mail Multipart for a multipart mail, which converts to the text of its first text part, with the files [...] 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..9ab7b0d32317 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,12 @@ 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. When set, the mail is sent as" + + " multipart/alternative with this text and the body (typically HTML) as its two parts, so" + + " mail clients that cannot show HTML show the text. 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..18e65c7b9a28 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,22 @@ public interface MailEndpointBuilderFactory { public String mailDelete() { return "CamelMailDelete"; } + /** + * The alternative body of the mail, as plain text. When set, the mail + * is sent as multipart/alternative with this text and the body + * (typically HTML) as its two parts, so mail clients that cannot show + * HTML show the text. 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 98d4bee263e7..6b088584c2f3 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() {
