Sendmail fix, #3299

This commit is contained in:
Ylian Saint-Hilaire 2021-11-26 10:51:34 -08:00
parent a8cba854de
commit 51744bb277
2 changed files with 8 additions and 3 deletions

View File

@ -1606,6 +1606,11 @@ function CreateMeshCentralServer(config, args) {
obj.mailserver = require('./meshmail.js').CreateMeshMail(obj);
obj.mailserver.verify();
if (obj.args.lanonly == true) { addServerWarning("SMTP server has limited use in LAN mode.", 18); }
} else if (obj.config.sendmail != null) {
// Sendmail server
obj.mailserver = require('./meshmail.js').CreateMeshMail(obj);
obj.mailserver.verify();
if (obj.args.lanonly == true) { addServerWarning("Sendmail has limited use in LAN mode.", 18); }
}
// Setup the email server for each domain

View File

@ -56,9 +56,9 @@ module.exports.CreateMeshMail = function (parent, domain) {
// 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; }
if (typeof obj.config.sendmail.newline == 'string') { options.newline = obj.config.sendmail.newline; }
if (typeof obj.config.sendmail.path == 'string') { options.path = obj.config.sendmail.path; }
if (Array.isArray(obj.config.sendmail.args)) { options.args = obj.config.sendmail.args; }
obj.smtpServer = nodemailer.createTransport(options);
}