Claus Ibsen created CAMEL-26040:
-----------------------------------
Summary: camel-aws2-ses - a RawMessage body is sent as the text of
a plain mail instead of as a raw mail
Key: CAMEL-26040
URL: https://issues.apache.org/jira/browse/CAMEL-26040
Project: Camel
Issue Type: Bug
Components: camel-aws2
Affects Versions: 4.18.0, 4.22.0, 4.23.0
Reporter: Claus Ibsen
Fix For: 4.24.0
CAMEL-21593 added the sending of an already created raw mail: "The ses producer
should check if the message body is already a {{SendRawEmailRequest}} and send
it as-is". The producer sends a raw mail ({{sendRawEmail}}) only for a
{{jakarta.mail.Message}} body ({{Ses2Producer}}, main 55dde649d405, line 59). A
{{RawMessage}} body of the AWS SDK goes to {{sendEmail}}: {{createMessage}}
takes {{raw.data().asUtf8String()}} as the text of a plain mail (lines
103-105). So the recipient gets a mail whose text is the MIME source of the raw
mail, with the subject of the endpoint, and the headers and parts of the raw
mail are not used. CAMEL-24238 fixed that text, which was the SdkBytes
descriptor, but kept the path, and
{{SesComponentTest.rawMessageBodyIsSentAsItsContentNotTheSdkBytesDescriptor}}
asserts the MIME source as the text of the mail. A {{SendRawEmailRequest}} body
is not handled at all: it is sent as its toString().
Read in the code; the unit test asserts it. Found while adding the catalog body
types of aws2-ses (CAMEL-24961), where a jakarta.mail MimeMessage body was sent
as a raw mail against the AWS emulator of camel infra.
*Proposed change*: send a {{RawMessage}} body with {{sendRawEmail}}, with the
destinations of the to option or header when they are set, and a
{{SendRawEmailRequest}} body as it is; note it in the upgrade guide, as the
mail the recipient gets changes.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)