Skip to content

Commit

Permalink
support for anonymous SMTP
Browse files Browse the repository at this point in the history
fixed logging bug
  • Loading branch information
taeguscromis committed Apr 24, 2019
1 parent 94f85ad commit 2dc59e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion units/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ exports.NodeGuard = function (cmdOptions, configOpts, rootPath, guardVersion) {

if (!signal) {
// only log is signall is empty which means it was spontaneous crash
logMessage(vsprintf("Node process closed with code %d", [code]), true);
logMessage(vsprintf("Node process closed with code %d", [code]), "error", true);
}

// check if we have crossed the maximum error number in short period
Expand Down
16 changes: 11 additions & 5 deletions units/notifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,21 @@ function notifyViaDiscord(config, msgText, msgType, nodeData) {
}

function notifyViaEmail(config, msgText, msgType, nodeData) {
// create reusable transporter object using the default SMTP transport
var auth = null;

if (oPath.get(config, 'error.notify.email.auth.username', '')) {
auth = {
user: oPath.get(config, 'error.notify.email.auth.username', ''),
pass: oPath.get(config, 'error.notify.email.auth.password', '')
};
}

// create transporter object using the default SMTP transport
const transporter = nodemailer.createTransport({
host: oPath.get(config, 'error.notify.email.smtp.host', ''),
port: oPath.get(config, 'error.notify.email.smtp.port', 25),
secure: oPath.get(config, 'error.notify.email.smtp.secure', false),
auth: {
user: oPath.get(config, 'error.notify.email.auth.username', ''),
pass: oPath.get(config, 'error.notify.email.auth.password', '')
},
auth: auth,
tls: {
rejectUnauthorized: false
}
Expand Down

0 comments on commit 2dc59e0

Please sign in to comment.