Added SMTP name, #3955.

Ylian Saint-Hilaire committed May 10, 2022 at 19:43 UTC 070a70650fc848d8e040599df70378035ddb75f9
2 files changed +10 -3
meshcentral-config-schema.json
+9 -2
@@ -944,14 +944,21 @@
944 "description": "Connects MeshCentral to a SMTP email server, allows MeshCentral to send email messages for 2FA or user notification.",
945 "type": "object",
946 "properties": {
947 + "name": {
948 + "type": "string",
949 + "format": "hostname",
950 + "description": "Optional hostname of the client, this defaults to the hostname of the machine. This is useful for SMTP relays."
951 + },
952 "host": {
953 "type": "string",
949 - "format": "hostname"
954 + "format": "hostname",
955 + "description": "Hostname of the SMTP server."
956 },
957 "port": {
958 "type": "integer",
959 "minimum": 1,
954 - "maximum": 65535
960 + "maximum": 65535,
961 + "description": "SMTP server port number."
962 },
963 "from": {
964 "type": "string",
meshmail.js
+1 -1
@@ -44,7 +44,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
44 } else if (obj.config.smtp != null) {
45 // Setup SMTP mail server
46 const nodemailer = require('nodemailer');
47 - var options = { host: obj.config.smtp.host, secure: (obj.config.smtp.tls == true), tls: {} };
47 + var options = { name: obj.config.smtp.name, host: obj.config.smtp.host, secure: (obj.config.smtp.tls == true), tls: {} };
48 //var options = { host: obj.config.smtp.host, secure: (obj.config.smtp.tls == true), tls: { secureProtocol: 'SSLv23_method', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false } };
49 if (obj.config.smtp.port != null) { options.port = obj.config.smtp.port; }
50 if (obj.config.smtp.tlscertcheck === false) { options.tls.rejectUnauthorized = false; }