cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Mail Sender Adapter Multipart Issue

Former Member
0 Kudos

Dear experts,

I have strange problem with a Sender Mail Adapter. It is polling an imap postbox.

Some mails cannot be proccessed in cause of content-type problems.

The mail contains attachment which should be transformed to the payload with PayloadSwapBean

Those mails producing this error are only from one and the same sender.

After research for this error I have found out, that the mail adapter has problems with the proccessing of multipart content.

The Email header in these error Mails look like this:

Subject: Order

Date: Fri, 15 Mar 2013 14:38:07 +0100

Message-ID: <5405EF35406D4864A6646CCA35699BB6@xxx.local>

MIME-Version: 1.0

X-Mailer: Microsoft Office Outlook 11

X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157

Thread-Index: Ac4hglN/wX0O15emSpCo7ZZOY1KrVg==

X-Scanned-By: aXs GUARD (http://www.axsguard.com)

X-pstn-neptune: 0/0/0.00/0

X-pstn-levels:     (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )

X-pstn-dkim: 0 skipped:not-enabled

X-pstn-status: off

Content-Type: multipart/mixed;

         boundary="----=_NextPart_000_003E_01CE218A.B5593950"

------=_NextPart_000_003E_01CE218A.B5593950

Content-Type: multipart/alternative;

         boundary="----=_NextPart_001_003F_01CE218A.B5593950"

------=_NextPart_001_003F_01CE218A.B5593950

Content-Transfer-Encoding: 7bit

Content-Type: text/plain;

         charset="us-ascii"

------=_NextPart_001_003F_01CE218A.B5593950

Content-Transfer-Encoding: quoted-printable

Content-Type: text/html;

         charset="us-ascii"

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =

xmlns:w=3D"urn:schemas-microsoft-com:office:word" =

xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =

charset=3Dus-ascii">

<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">

<style.........................

I have already tried to change content type with MessageTransformBean. But this does not solve the problem.

Does anybody of you have an solution or workaround for this?

Many thanks!

Best regards,

Fabian

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

This is a nested multipart. The first part of the multi part is again a multipart.

The SOAP and Mail adapter can only handle straight multipart, not nested.

I am sorry, there is no way to handle this in standard.

In principle you have to describe in your integration specification, how the mail should look like and the sender of the mail should make sure, that the mail is created according to the specification.

In your case the mail was created with Outlook. In Outlook you can decide, whether you send a mail as plain text, RTF or HTML. Here the sender has to choose plain text.

Former Member
0 Kudos

Is there a solution to this yet or is there a possible work around for this issue?

I'm facing the above discussed issue too. When the email is sent in HTML format by the user, the sender mail adapter gets a huge unreadable junk content.

To avoid this, I set the MIME format of messages in the Microsoft Exchange Email Server to "Text". This would define how the messages are retrieved from the server, irrespective of the format in which the user composes the email. With this setting in place, the mail adapter started retrieving the message in a clear and readable format except for one scenario.

If the user sends an email in HTML format + embeds an HTML image / Hot Spot image with in the body of the email (Ex: Images in the Signature such as the Facebook, Twitter images) + includes an attachment(such as pdf, word document etc.), then the mail adapter retrieves the messages in an unreadable content that is simply huge & junk. The message received by PI is a nested multi part content

Is there a way to get around this issue?

Appreciate all inputs / suggestions to handle this problem scenario!

Many Thanks,

MCK

iaki_vila
Active Contributor
0 Kudos

Hi Fabian,

Are you getting the exception  com.sap.aii.af.sdk.xi.lang.BinaryIndexOutOfBoundsException: Binary ?

Regards.

Former Member
0 Kudos

Hi Inaki,

no i am not getting this exception.

Do you know any other possibility to switch/remove the multipart content type or simplify to a single type? ex. application/text.

This error only occurs, when mail has more than one content type "multipart/mixed boundary" part.

Thanks and regards!

Former Member
0 Kudos

This Error only occurs, if the Mail was sent as html file!

Do you know how I can handle these html files?