Email Processing with NodeJS

I am writing a Node application that, among other things, needs to receive email and process it so that it can be displayed on a web page (as happens in web mail, list archives, etc.). I have a reception area covered by Haraka ( https://github.com/baudehlo/Haraka ). From there, it is easy to store received messages in Mongo, and as long as they are plain text, I can display them.

The parts that I am missing handle the pretty involved varieties of ways email content can appear, including alternatives, HTML, attachments, inline images, and more. This is a pretty cool feature that needs to be built, and I cannot find the JS library that will do this for me. Given the number of libraries and the speed of adding new ones, maybe I just skipped this, so welcome pointers!

And if this happens, if I had to transfer the existing library for this from another language, which one would you recommend, I look?

Thanks!

+7
source share
3 answers

You should check haraka-couchdb and other maxogden work.

https://github.com/maxogden/haraka-couchdb

https://github.com/maxogden/couchmail

Haraka-CouchDB is engaged in storage of attachments. At least he should tell you how to do this with Mongo too.

At some point, I hope to place a simpler layer above the email parser in Haraka, so that you can simply view the contents of the email easily, but this requires an HTML to javascript converter. Or I think you could do it the other way around and convert the text to HTML.

+4
source

Maybe I answered a little late, but I had a similar requirement for persistent letters in mongo-db. I created this code stub that receives the body of emails and inserts into mongo. The next iteration is the attachment.

The plugin can be found at https://github.com/jamescowie/haraka-mongo

+4
source

Check out Kyatchi β†’ https://github.com/hamin/kyatchi

hope that helps

+2
source

All Articles