Email - nsure imap tries to disconnect nicely first.... then destroy

to close #784
This commit is contained in:
Dave Conway-Jones 2021-03-28 16:55:28 +01:00
parent 5dd03b7073
commit c1e83bf06f
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 13 additions and 3 deletions

View File

@ -506,7 +506,11 @@ module.exports = function(RED) {
if (this.interval_id != null) {
clearTimeout(this.interval_id);
}
if (imap) { imap.destroy(); }
if (imap) {
imap.end();
setTimeout(function() { imap.destroy(); },1000);
node.status({});
}
});
function setInputRepeatTimeout() {

View File

@ -1,6 +1,6 @@
{
"name": "node-red-node-email",
"version": "1.10.0",
"version": "1.10.1",
"description": "Node-RED nodes to send and receive simple emails.",
"dependencies": {
"imap": "^0.8.19",
@ -9,7 +9,13 @@
"nodemailer": "~6.5.0",
"smtp-server": "^3.8.0"
},
"bundledDependencies" : ["imap","poplib","mailparser","nodemailer","smtp-server"],
"bundledDependencies": [
"imap",
"poplib",
"mailparser",
"nodemailer",
"smtp-server"
],
"repository": {
"type": "git",
"url": "https://github.com/node-red/node-red-nodes/tree/master/social/email"