admin管理员组

文章数量:1278910

I'm writing a Node application which among other things needs to receive email and process it so that it can be rendered in a Web page (as happens in Web mail, list archives, etc.). I've got the receiving part covered with Haraka (). From there to storing the received emails in Mongo is easy, and so long as they're plain text I can display them.

The part I'm missing is handling the rather involved varieties of ways in which email content can e, including alternatives, HTML, attachments, inlined images, and much more. That's a rather steep amount of functionality to have to put together, and I can't seem to find a JS library that will do it for me. Given the number of libraries out there and the speed at which new ones are added, it might just be that I've missed it — so pointers wele!

And failing that, if I were to port an existing library for this over from another language, which one(s) would you remend I look at?

Thanks!

I'm writing a Node application which among other things needs to receive email and process it so that it can be rendered in a Web page (as happens in Web mail, list archives, etc.). I've got the receiving part covered with Haraka (https://github./baudehlo/Haraka). From there to storing the received emails in Mongo is easy, and so long as they're plain text I can display them.

The part I'm missing is handling the rather involved varieties of ways in which email content can e, including alternatives, HTML, attachments, inlined images, and much more. That's a rather steep amount of functionality to have to put together, and I can't seem to find a JS library that will do it for me. Given the number of libraries out there and the speed at which new ones are added, it might just be that I've missed it — so pointers wele!

And failing that, if I were to port an existing library for this over from another language, which one(s) would you remend I look at?

Thanks!

Share Improve this question edited Sep 7, 2011 at 22:25 karlcow 6,9724 gold badges41 silver badges72 bronze badges asked Sep 7, 2011 at 22:03 Robin BerjonRobin Berjon 1,01312 silver badges10 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

You should check out haraka-couchdb and the other work maxogden is doing.

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

https://github./maxogden/couchmail

Haraka-CouchDB deals with storing the attachments. At the very least it should tell you how to do it with Mongo too.

At some point I'm hoping to put a simpler layer over the email parser in Haraka, so that you can just see the email contents easily - but that requires a javascript HTML to Text converter. Or I guess you could do it the other way around and convert the Text to HTML.

Im probably a little late responding, But I had a similar requirement for persisting emails in mongo-db. I created this stub of code that gets the body of emails and inserts into mongo, Next iteration is attachments.

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

Check out Kyatchi -> https://github./hamin/kyatchi

hope that helps

本文标签: javascriptEmail processing with NodeJSStack Overflow