Hi,

My guess is that the file component doesn't support the attachments API (as
noted here:
https://camel.apache.org/components/latest/mail-component.html#_sending_mail_with_attachment_sample
).

One trick could be to route your deadLetterChannel to a direct route, and
from there use:
1. the file component to store the body on disk (as you are doing right now)
2. the splitter EIP to iterate over the attachments using the
SplitAttachmentsExpression(true) (
https://camel.apache.org/components/latest/mail-component.html#_how_to_split_a_mail_message_with_attachments)
and then store them on disk as well by setting the appropriate file
component headers using the CamelSplitAttachmentId exchange header to
recover the attachment name.

Giovanni

Il giorno gio 19 set 2019 alle ore 13:25 <thomas.thi...@telekom.de> ha
scritto:

> Hi,
>
> I send an email with formatting, html or rtf and a pdf as attachment.
> But in the dead letter file there is only plain text.
> How can I save the orginal email in case of exception?
>
> Code so far in configure():
>
> errorHandler(deadLetterChannel(String.format("file://%s",
> EMAIL_DEADDIRECTORY)).useOriginalMessage());
>
> from(("imap:// ...").routeId("EmailInput")
>    .throwException(IllegalArgumentException.class, "test")
>    .to("direct:emailin");
>
>
>

Reply via email to