mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
email don't retry connection while still busy.
This commit is contained in:
parent
53ad00f165
commit
46f3dfc382
@ -348,10 +348,10 @@ module.exports = function(RED) {
|
|||||||
//console.log("> Inbox err : %j", err);
|
//console.log("> Inbox err : %j", err);
|
||||||
//console.log("> Inbox open: %j", box);
|
//console.log("> Inbox open: %j", box);
|
||||||
if (err) {
|
if (err) {
|
||||||
s = false;
|
|
||||||
node.status({fill:"red", shape:"ring", text:"email.status.foldererror"});
|
node.status({fill:"red", shape:"ring", text:"email.status.foldererror"});
|
||||||
node.error(RED._("email.errors.fetchfail", {folder:node.box}),err);
|
node.error(RED._("email.errors.fetchfail", {folder:node.box}),err);
|
||||||
imap.end();
|
imap.end();
|
||||||
|
s = false;
|
||||||
setInputRepeatTimeout();
|
setInputRepeatTimeout();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -412,6 +412,7 @@ module.exports = function(RED) {
|
|||||||
var cleanup = function() {
|
var cleanup = function() {
|
||||||
imap.end();
|
imap.end();
|
||||||
s = false;
|
s = false;
|
||||||
|
setInputRepeatTimeout();
|
||||||
};
|
};
|
||||||
if (this.disposition === "Delete") {
|
if (this.disposition === "Delete") {
|
||||||
imap.addFlags(results, "\Deleted", cleanup);
|
imap.addFlags(results, "\Deleted", cleanup);
|
||||||
@ -420,11 +421,12 @@ module.exports = function(RED) {
|
|||||||
} else {
|
} else {
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
setInputRepeatTimeout();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch.once('error', function(err) {
|
fetch.once('error', function(err) {
|
||||||
console.log('Fetch error: ' + err);
|
console.log('Fetch error: ' + err);
|
||||||
|
imap.end();
|
||||||
|
s = false;
|
||||||
setInputRepeatTimeout();
|
setInputRepeatTimeout();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -442,7 +444,7 @@ module.exports = function(RED) {
|
|||||||
if (node.protocol === "POP3") {
|
if (node.protocol === "POP3") {
|
||||||
checkPOP3(msg);
|
checkPOP3(msg);
|
||||||
} else if (node.protocol === "IMAP") {
|
} else if (node.protocol === "IMAP") {
|
||||||
if (s === false) { checkIMAP(msg); }
|
if (s === false && ss == false) { checkIMAP(msg); }
|
||||||
}
|
}
|
||||||
} // End of checkEmail
|
} // End of checkEmail
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-email",
|
"name": "node-red-node-email",
|
||||||
"version": "1.7.8",
|
"version": "1.7.9",
|
||||||
"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",
|
||||||
"mailparser": "^2.7.7",
|
"mailparser": "^2.8.1",
|
||||||
"nodemailer": "^6.4.6",
|
"nodemailer": "^6.4.11",
|
||||||
"poplib": "^0.1.7"
|
"poplib": "^0.1.7"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
Loading…
Reference in New Issue
Block a user