jprobinson / eazye

The gangsta gangsta way to pull email

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this package support fetching of attachments?

avishbran opened this issue · comments

Howdy @avishbran

eazye does not provide any extra funcs or methods to parse attachments, but you could use mime/multipart to traverse the parts of the mail.Message struct embedded in eazye's Email type to find and read an attachment on an email.

I don't suppose you have an example of parsing attachments?

Nothing that's open source/written in the last 5 years 😅

I believe it comes down to using https://golang.org/pkg/mime/multipart/#Reader to iterate to/read in each "part" of the message. I believe the headers of each part should let you know if the contents are an attachment and how things are encoded so you can decide to read/decode the payload.