slight adjust email retry timeout

This commit is contained in:
Dave Conway-Jones 2020-01-31 21:46:42 +00:00
parent 90a00279c0
commit 5780b2a5c3
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
2 changed files with 81 additions and 78 deletions

View File

@ -158,6 +158,9 @@ module.exports = function(RED) {
this.repeat = 2147483647; this.repeat = 2147483647;
this.error(RED._("email.errors.refreshtoolarge")); this.error(RED._("email.errors.refreshtoolarge"));
} }
if (this.repeat < 1500) {
this.repeat = 1500;
}
if (this.inputs === 1) { this.repeat = 0; } if (this.inputs === 1) { this.repeat = 0; }
this.inserver = n.server || (globalkeys && globalkeys.server) || "imap.gmail.com"; this.inserver = n.server || (globalkeys && globalkeys.server) || "imap.gmail.com";
this.inport = n.port || (globalkeys && globalkeys.port) || "993"; this.inport = n.port || (globalkeys && globalkeys.port) || "993";
@ -451,8 +454,8 @@ module.exports = function(RED) {
port: node.inport, port: node.inport,
tls: node.useSSL, tls: node.useSSL,
tlsOptions: { rejectUnauthorized: false }, tlsOptions: { rejectUnauthorized: false },
connTimeout: node.repeat, connTimeout: node.repeat - 500,
authTimeout: node.repeat authTimeout: node.repeat - 500
}); });
imap.on('error', function(err) { imap.on('error', function(err) {
if (err.errno !== "ECONNRESET") { if (err.errno !== "ECONNRESET") {

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-email", "name": "node-red-node-email",
"version": "1.7.5", "version": "1.7.6",
"description": "Node-RED nodes to send and receive simple emails", "description": "Node-RED nodes to send and receive simple emails",
"dependencies": { "dependencies": {
"imap": "^0.8.19", "imap": "^0.8.19",