1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Updated Email (markdown)

Neil Kolban 2016-03-06 19:46:19 -06:00
parent 324000890d
commit a2a716542f

@ -7,18 +7,51 @@ As of 2016-03-06, the node has dependencies on:
* [nodemailer](https://www.npmjs.com/package/nodemailer)
* [imap](https://www.npmjs.com/package/imap)
---
## Reading emails
The current implementation uses the [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) protocol to interact with a back-end IMAP provider. The very last email seen is received and the message added to an emitted event. If the email body is plain text, it is added to `msg.payload`. If the email body is HTML, it is added to `msg.html`.
The current implementation uses the [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) protocol to interact with a back-end IMAP provider. The very last email seen is received and the message added to an emitted event. If the email body is plain text, it is added to `msg.payload`. If the email body is HTML, it is added to `msg.html`. The subject line of the email is propagated in `msg.topic`.
---
### Future enhancements
There are a number of potential enhancements available to the email node that can be addressed. These include:
* Support of IMAP that is not over SSL/TLS.
* Support for self-certified SSL certificates.
* Support for attachment processing.
* Support for attachment processing. Attachments should appear as an array in `msg.attachments`.
* Support for POP3 as well as IMAP.
* Support for more than just last message processing.
---
### Design Notes
#### Parsing incoming emails
Consider an email message that is sitting on an email server. It appears that an email is transmitted over SMTP and received by the email server and stored. It also appears that the email is saved in a certain format. That email can then be retrieved by a client application using IMAP and/or POP3.
__Question__: Is the email message retrieved via IMAP and POP3 the same format/content? If I retrieve the "blob-o-data" that represents my email, do I get the same think with both IMAP and POP3 retrievers?
---
### Related forum posts and issues:
* [Retrieving email attachments using the email input node](https://groups.google.com/d/msg/node-red/UMIJyGVab-A/mLG7quyKBAAJ
* Forum: [Retrieving email attachments using the email input node](https://groups.google.com/d/msg/node-red/UMIJyGVab-A/mLG7quyKBAAJ)
* Issue: #641 - [Email input issue / special EOL characters?](https://github.com/node-red/node-red/issues/641)
* Issue: #182 - [Email-in: duplicate not sent / Error: read ECONNRESET](https://github.com/node-red/node-red-nodes/issues/182)
* Issue: #123 - [extending e-mail node's usage of nodemailer createTransport](https://github.com/node-red/node-red-nodes/issues/123)
* Issue: #132 - [social/email-in module cannot get mail](https://github.com/node-red/node-red-nodes/issues/132)
---
### Related NPM packages
* [mailparser](https://www.npmjs.com/package/mailparser) - Parse an email message.
* [nodemailer](https://www.npmjs.com/package/nodemailer) - Send an SMTP email.
* [imap](https://www.npmjs.com/package/imap) - Receive a message via IMAP.
* [poplib](https://www.npmjs.com/package/poplib) - POP3 client.
---
### Technical tasks
* How do we retrieve an email using POP3?