1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Bug fixes, added AmtWake to MeshCMD.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-13 00:27:31 -07:00
parent f4a8981d4f
commit 04dfeebe1e
10 changed files with 584 additions and 358 deletions

View file

@ -300,14 +300,25 @@ module.exports.CreateMeshMail = function (parent) {
parent.debug('email', 'SMTP response: ' + JSON.stringify(err) + ', ' + JSON.stringify(info));
obj.sendingMail = false;
if (err == null) {
// Send the next mail
obj.pendingMails.shift();
obj.retry = 0;
sendNextMail(); // Send the next mail
sendNextMail();
} else {
obj.retry++;
parent.debug('email', 'SMTP server failed: ' + JSON.stringify(err));
console.log('SMTP server failed: ' + JSON.stringify(err));
if (obj.retry < 6) { setTimeout(sendNextMail, 60000); } // Wait and try again
parent.debug('email', 'SMTP server failed (Retry:' + obj.retry + '): ' + JSON.stringify(err));
console.log('SMTP server failed (Retry:' + obj.retry + '/3): ' + JSON.stringify(err));
// Wait and try again
if (obj.retry < 3) {
setTimeout(sendNextMail, 10000);
} else {
// Failed, send the next mail
parent.debug('email', 'SMTP server failed (Skipping): ' + JSON.stringify(err));
console.log('SMTP server failed (Skipping): ' + JSON.stringify(err));
obj.pendingMails.shift();
obj.retry = 0;
sendNextMail();
}
}
});
}