Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The unmarshal option of the mime-multipart data format will convert a MIME-Multipart message into a camel message with attachments and leaves other messages alone. MIME-Headers of the MIME-Multipart message have to be set as Camel headers. The unmarshalling will only take place if the "Content-Type" header is set to a "multipart" type. If the option "headersInline" is set to true, the body is always parsed as a MIME message.As a consequence if the message body is a stream and stream caching is not enabled, a message body that is actually not a MIME message with MIME headers in the message body will be replaced by an empty message. Up to Camel version 2.17.1 this will happen all message bodies that do not contain a MIME multipart message regardless of body type and stream cache setting.

Options

OptionDefaultDescription
multipartWithoutAttachmentfalseIf set to true the marshal operation will create a multipart (with a single part) if the message does not contain any attachments. If this is set to false it will leave messages without attachments alone.
headersInlinefalse

If set to true the marshal operation will add the MIME headers of the Multipart as part of the message body and not as a camel header. In case of a unmarshal operations the MIME headers are assumed to be contained in the message body and the operation will always parse the message as MIME message.

Note: Any message is a valid MIME message, so the unmarshal operation with this parameter set to true will never result in an error. However if the parsing result does not contain any MIME part, starting with Camel 2.17.2 the unmarshaller tries to restore the original message. If this is not possible because the message body is a stream and stream caching is not enabled or with older Camel versions, the resulting message body is empty.

Note: If the headersInline parameter is set to "true", the message will also always be rendered into a MIME multipart regardless whether it has an attachment or not.

includeHeaders 

null

A regex that defines which Camel headers are also included as MIME headers into the MIME multipart. This will only work if headersInline is set to true.
Default is to include no Camel headers.

binaryContentfalseIf set to true non-text content will be transferred in binary mode, if set to false (default) binary content will be transferred in base64 encoding. This is shorter but might not work for all transfer methods.
multipartSubTypemixedThe subtype of the generated MIME multipart. Other options are related, alternative, digest, or parallel. The data type does not enforce any semantics for these subtypes (so e.g. the user has to make sure that the first body part of a multipart/digest message is proper message/rfc822 data). The default mixed is usually a good choice.

...