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

Allow Email node to select folder other than INBOX

Closes #215
Thanks to @aamol for spotting
This commit is contained in:
Dave Conway-Jones 2016-06-27 12:01:19 +01:00
parent 46cc9bb906
commit 4c589f14f5

View File

@ -318,7 +318,7 @@ module.exports = function(RED) {
node.status({fill:"blue", shape:"dot", text:"email.status.fetching"}); node.status({fill:"blue", shape:"dot", text:"email.status.fetching"});
//console.log("> ready"); //console.log("> ready");
// Open the inbox folder // Open the inbox folder
imap.openBox('INBOX', // Mailbox name imap.openBox(node.box, // Mailbox name
false, // Open readonly? false, // Open readonly?
function(err, box) { function(err, box) {
//console.log("> Inbox open: %j", box); //console.log("> Inbox open: %j", box);
@ -412,7 +412,7 @@ module.exports = function(RED) {
connTimeout: node.repeat, connTimeout: node.repeat,
authTimeout: node.repeat authTimeout: node.repeat
}); });
imap.on('error', function(err) { imap.on('error', function(err) {
if (err.errno !== "ECONNRESET") { if (err.errno !== "ECONNRESET") {
node.log(err); node.log(err);
node.status({fill:"red",shape:"ring",text:"email.status.connecterror"}); node.status({fill:"red",shape:"ring",text:"email.status.connecterror"});