diff --git a/meshcentral.js b/meshcentral.js index 0b441d90..530cb53e 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -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 diff --git a/meshmail.js b/meshmail.js index df8ffa90..de8d9702 100644 --- a/meshmail.js +++ b/meshmail.js @@ -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); }