From 55f6609a4f31f396a49563908c17b0b0bb2ab27b Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 9 Feb 2020 14:11:54 +0000 Subject: [PATCH] Fix email node timeout when triggered manually --- social/email/61-email.js | 5 +++-- social/email/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index a2d4c76d..2dbfad24 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -447,6 +447,7 @@ module.exports = function(RED) { } // End of checkEmail if (node.protocol === "IMAP") { + var tout = (node.repeat > 0) ? node.repeat - 500 : 15000; imap = new Imap({ user: node.userid, password: node.password, @@ -454,8 +455,8 @@ module.exports = function(RED) { port: node.inport, tls: node.useSSL, tlsOptions: { rejectUnauthorized: false }, - connTimeout: node.repeat - 500, - authTimeout: node.repeat - 500 + connTimeout: tout, + authTimeout: tout }); imap.on('error', function(err) { if (err.errno !== "ECONNRESET") { diff --git a/social/email/package.json b/social/email/package.json index 8730ac0f..c2575eb2 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-email", - "version": "1.7.6", + "version": "1.7.7", "description": "Node-RED nodes to send and receive simple emails", "dependencies": { "imap": "^0.8.19",