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

Added Sendmail support, #3299

This commit is contained in:
Ylian Saint-Hilaire 2021-11-25 10:34:21 -08:00
parent 725f9923e7
commit 58f611ce72
4 changed files with 24 additions and 1 deletions

View file

@ -52,6 +52,14 @@ module.exports.CreateMeshMail = function (parent, domain) {
if ((obj.config.smtp.user != null) && (obj.config.smtp.pass != null)) { options.auth = { user: obj.config.smtp.user, pass: obj.config.smtp.pass }; }
if (obj.config.smtp.verifyemail == true) { obj.verifyemail = true; }
obj.smtpServer = nodemailer.createTransport(options);
} else if (obj.config.sendmail != null) {
// Setup Sendmail
const nodemailer = require('nodemailer');
var options = { sendmail: true };
if (typeof obj.config.smtp.newline == 'string') { options.newline = obj.config.smtp.newline; }
if (typeof obj.config.smtp.path == 'string') { options.path = obj.config.smtp.path; }
if (Array.isArray(obj.config.smtp.args)) { options.args = obj.config.smtp.args; }
obj.smtpServer = nodemailer.createTransport(options);
}
// Get the correct mail template object