Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Find Attachments, dont matter the content-type msg #25

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

marcospgmelo
Copy link

@marcospgmelo marcospgmelo commented Sep 23, 2020

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: test@example.com.br
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.

Decode text/plain and text/html body with encoding
use case-insensitive string to compare the encoding fields like Conte…
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants