ditesh / node-poplib

POP3 client library for Node.js
MIT License
128 stars 44 forks source link

Any quick example for headers parsing? #17

Closed beshur closed 10 years ago

beshur commented 10 years ago

Hi.

Maybe anyone has a simple example what can be done to the results of retr to actually work with the emails?

Thanks.

Sjonnie2nd commented 10 years ago

Hi Beshur,

POP3 is a relative simple and stable protocol to retrieve emails. What to do afterwards with the retrieved emails is far from simple and a bit off-topic here.

Best first step is to save it in a database (in my case: MongoDB) and do nothing with it until the POP3 connection has finished.

Then if you want to view the received emails it gets lots more complicated: How to handle multipart/alternative plain text and html parts. How to handle (inline) attachments. How to handle malformed emails, etc.. I would suggest to take a look at the node MailParser library built by Andris Reinman: https://github.com/andris9/mailparser.

Greetings.

beshur commented 10 years ago

Thanks for reply, @Sjonnie2nd.

I've already started looking on mailparser, but decided to keep it a bit off for now.