cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Mail adapter encounters MalformedInputException

Former Member
0 Kudos

I have a sender mail adapter that processes the attached .csv file. All is working fine. I use FCC in module to convert the attachment and pass to an IDOC adapter for processing in SAP system.

My problem is sometimes the sender mail CC fails with ...........

exception caught during processing mail message[1]; com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException

It only fails with some files. At the moment when we test we FORWARD the email to our email account. If I detach the failed email attachment and attach it to a NEW email it will then work.

So why does it not work when forwarding emails? But it works when I attach the same file to a new email and send?

Other threads for this error seem to point to encoding. But how do I know which to use. I currently use the following in my module config:

Transfer.ContentType application/octet-stream;charset="ISO-8859-1"

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check this URL for Sener Mail Adapter Configuration guide:

http://help.sap.com/saphelp_nw2004s/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm

Thanks,

Boopathi

Former Member
0 Kudos

"It seems that in a forwarded mail there are additional attachments, which are empty."

This could explain it, but most email attachments that are forwarded work - it's just some that don't. You would have thought it would always do the same thing!

"You can try searching the attachment by content type, if you are sure that the content type is always the same. Is there a pattern for the attachment name?"

The test messages that they send now have all different attachment names - but I can request that they send a particular attachment name. What do I need to do to search the attachment by content type?

stefan_grube
Active Contributor
0 Kudos

set swap.keyName = content-type and swap.keyValue = any sub string of the content type value.

If content-type = application/xml;filename="test.xml" you can use as substring for example:

application/xml

.xml

Regards

Stefan

stefan_grube
Active Contributor
0 Kudos

Hi Lynn,

> So why does it not work when forwarding emails? But it works when I attach the same file to a new email and send?

The issue might come from your email client. The email is different, when forwarded.

> Other threads for this error seem to point to encoding. But how do I know which to use. I currently use the following in my module config:

I don't think so.

> Transfer.ContentType application/octet-stream;charset="ISO-8859-1"

charset does not make sense for octet-stream. You can use this for text only (like text/plain)

Do you use the payloadswapbean? Which parameters do you have here?

Regards

Stefan

Former Member
0 Kudos

I have this in my configuration:

localejbs/AF_Modules/PayloadSwapBean on local

TRANSFORM

localejbs/AF_Modules/MessageTransformBean on local

txtxml

TRANSFORM swap.keyName payload-name

TRANSFORM swap.keyValue MailAttachment-1

txtxml Transfer.ContentType application/octet-stream;charset="ISO-8859-1"

txtxml Transform.Class com.sap.aii.messaging.adapter.Conversion

txtxml Transform.ContentDescription MailAttachment-1

txtxml Transform.ContentDisposition attachment;filename="MailAttachment-1.bin"

txtxml xml.conversionType SimplePlain2XML

txtxml xml.documentName MT_BCD_INVOICES

txtxml xml.documentNamespace urn://federalmogul.com/BCDTRAVEL/FINGLOBCD001/00

txtxml xml.fieldNames COST_CENTRE,EMPLOYEE_ID,PRODUCT_GROUP,COMP_CODE,BCD_ACCOUNT,INVOICE_DATE,TRAVELER_NAME,TRAVELER_FIRST_NAME,INVOICE_NO,AMOUNT_EXCL_VAT,CURRENCY1,AMOUNT_VAT,CURRENCY2,AMOUNT_DOC_CURRENCY,CURRENCY3

txtxml xml.fieldSeparator ;

txtxml xml.lastFieldsOptional YES

txtxml xml.processFieldNames fromConfiguration

txtxml xml.structureTitle RECORDSET

stefan_grube
Active Contributor
0 Kudos

With this configuration, you always read the first attachment. It seems that in a forwarded mail there are additional attachments, which are empty.

You can try searching the attachment by content type, if you are sure that the content type is always the same. Is there a pattern for the attachment name?

Regards

Stefan

former_member181962
Active Contributor
0 Kudos

Hi Lynn,

This document will provide more info about encoding in adapters:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79...

Regards,

Ravi