Unable to read Email attachment from service invoked by IMAP

Hi,

I am currently developing a service which is invoked by E-Mail Port (IMAP) to read data from attachment or body of the email.

Without attachment I am able to read the body of the email using the following services.

→ pub.flow:getTransportInfo
→ pub.mime:createMimeData
→ pub.mime.getBodyPartContent
→ sample.mime.helpers:streamToString
→ pub.string.stringToBytes

and writing the values into a file

No value is coming up in the pipeline if attachment is in the email. I need to read the attachment of the email.

Many thanks for any help offered.

Swami

Swami,

I am trying the opposite of what you’re doing. I can get the contents of the attachment, but can’t get the body the email that has a single body part.

Are you using single or multipart messages?

Dave

Dave:

I tried with multi part messages.

With the help of the following services

pub.mime.createMimeData,
pub.mime.getBodyPartContent,
sample.mime.helpers:streamToString

I am able to read the body. You should have a input ‘ffdata’ object and make use of that.

In my case, I am trying to read a zip file contents. Can you please tell me how you managed to read the attachment.

Thanks,
Swami

Swami,

I have a service with 1 input named contentStream that is an object type. Then I
call the following services:

pub.mime:createMimeData
pub.mime:getBodyPartContent

after calling getBodyPartContent you should have the the attachment in the content variable.

This worked for me using an POP3 email port.

Dave

Hello

Were you able to solve the issue? I am also having the same problem, when i try to read from IMAP. Only the email headers are present in the pipeline, when i try to debug. The contentStream is not visible. Plz help

Thanks
Anish,