I am writing a simple software that needs to:
- Connect to an IMAP server
- Download all unread messages
- Store each message's body, and attachment. I prefer the body as text.
- Mark them as read
I am reading https://github.com/mscdex/node-imap; however, a message can be in multiple parts, and that's where I am lost. For example, when it's multi-part, what is the part that is guaranteed to be the actual email body?
Or, even better, is there a wrapper out there that will just return a nice "message" object, all neatly fetched and prepared for me? Something with the usual headers (from, to, etc.), to body, and a bunch of pre-decoded attachment?
Merc.