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

check header properties in email node

to close #118
This commit is contained in:
Dave Conway-Jones 2015-06-19 22:34:07 +01:00
parent fc05ddd035
commit d21b24bbce
2 changed files with 4 additions and 4 deletions

View File

@ -202,9 +202,9 @@ module.exports = function(RED) {
stream.on('end', function() { stream.on('end', function() {
if (info.which !== 'TEXT') { if (info.which !== 'TEXT') {
var head = Imap.parseHeader(buffer); var head = Imap.parseHeader(buffer);
pay.from = head.from[0]; if (head.hasOwnProperty("from")) { pay.from = head.from[0]; }
pay.topic = head.subject[0]; if (head.hasOwnProperty("topic")) { pay.topic = head.subject[0]; }
pay.date = head.date[0]; if (head.hasOwnProperty("date")) { pay.date = head.date[0]; }
pay.header = head; pay.header = head;
} else { } else {
var parts = buffer.split("Content-Type"); var parts = buffer.split("Content-Type");

View File

@ -1,6 +1,6 @@
{ {
"name" : "node-red-node-email", "name" : "node-red-node-email",
"version" : "0.0.3", "version" : "0.0.4",
"description" : "Node-RED nodes to send and receive simple emails", "description" : "Node-RED nodes to send and receive simple emails",
"dependencies" : { "dependencies" : {
"nodemailer" : "1.3.4", "nodemailer" : "1.3.4",