jhillyerd / enmime

MIME mail encoding and decoding package for Go
MIT License
461 stars 100 forks source link

Failing to find attachments for emails sent by apple mail #311

Closed pushkar-anand closed 11 months ago

pushkar-anand commented 11 months ago

What I did:

I was trying to parse an email(containing an attachment) sent using Apple Mail.

The raw email mime content: https://pastebin.com/raw/Md4fRHA6

Go Playground: https://go.dev/play/p/LNvpp4dFplw

What I expected:

The parsed envelope should contain 1 attachment

What I got:

No attachment detected

Release or branch I am using: v1.0.1

jhillyerd commented 11 months ago

Because the attachment has Content-Disposition: inline it's considered an inline instead of an attachment, this prints len of 1:

fmt.Println("Total Attachments:", len(envelope.Inlines))

You can also use our mime-dump command to debug this sort of thing.

pushkar-anand commented 11 months ago

My bad. Thanks for the quick help.