parsemail icon indicating copy to clipboard operation
parsemail copied to clipboard

Find Attachments, dont matter the content-type msg

Open marcospgmelo opened this issue 4 years ago • 0 comments

I was trying to read an Email with a file.txt in attachment.

But, when the code run and see every kind of content-type, the searching for attachments was missed.

putting the search out of the "IF's chain", the message got all my attachment's.

As you can see the in case below:

_Subject: myTestFile txt To: [email protected] Content-Type: multipart/mixed; boundary="00000000000028c8b805affc4d1e"

--00000000000028c8b805affc4d1e Content-Type: multipart/alternative; boundary="00000000000028c8b705affc4d1c"

--00000000000028c8b705affc4d1c Content-Type: text/plain; charset="UTF-8"

--00000000000028c8b705affc4d1c Content-Type: text/html; charset="UTF-8"


--00000000000028c8b705affc4d1c-- --00000000000028c8b805affc4d1e Content-Type: text/plain; charset="US-ASCII"; name="myTestFile.txt" Content-Disposition: attachment; filename="myTestFile.txt" Content-Transfer-Encoding: base64 Content-ID: <f_kffi1n1v0> X-Attachment-Id: f_kffi1n1v0_

once the program search for the text/plain, the attachment was been ignored.

marcospgmelo avatar Sep 23 '20 19:09 marcospgmelo