Sendmail fix, #3299
Ylian Saint-Hilaire committed
Nov 26, 2021 at 10:51 UTC
51744bb277fd6079f7c69d30d6dc09604d01e536
2 files changed
+8
-3
meshcentral.js
+5
@@ -1606,6 +1606,11 @@ function CreateMeshCentralServer(config, args) {
1606
obj.mailserver = require('./meshmail.js').CreateMeshMail(obj);
1607
obj.mailserver.verify();
1608
if (obj.args.lanonly == true) { addServerWarning("SMTP server has limited use in LAN mode.", 18); }
1609
+ } else if (obj.config.sendmail != null) {
1610
+ // Sendmail server
1611
+ obj.mailserver = require('./meshmail.js').CreateMeshMail(obj);
1612
+ obj.mailserver.verify();
1613
+ if (obj.args.lanonly == true) { addServerWarning("Sendmail has limited use in LAN mode.", 18); }
1614
}
1615
1616
// Setup the email server for each domain
meshmail.js
+3
-3
@@ -56,9 +56,9 @@ module.exports.CreateMeshMail = function (parent, domain) {
56
// Setup Sendmail
57
const nodemailer = require('nodemailer');
58
var options = { sendmail: true };
59
- if (typeof obj.config.smtp.newline == 'string') { options.newline = obj.config.smtp.newline; }
60
- if (typeof obj.config.smtp.path == 'string') { options.path = obj.config.smtp.path; }
61
- if (Array.isArray(obj.config.smtp.args)) { options.args = obj.config.smtp.args; }
59
+ if (typeof obj.config.sendmail.newline == 'string') { options.newline = obj.config.sendmail.newline; }
60
+ if (typeof obj.config.sendmail.path == 'string') { options.path = obj.config.sendmail.path; }
61
+ if (Array.isArray(obj.config.sendmail.args)) { options.args = obj.config.sendmail.args; }
62
obj.smtpServer = nodemailer.createTransport(options);
63
}
64