Changed SMTP TLS security options.
Ylian Saint-Hilaire committed
Aug 26, 2019 at 15:51 UTC
f54a31e7068a840c4f2e51c9bd4b2bbe2fa13431
2 files changed
+3
-2
meshmail.js
+2
-1
@@ -25,13 +25,14 @@ module.exports.CreateMeshMail = function (parent) {
25
obj.sendingMail = false;
26
obj.mailCookieEncryptionKey = null;
27
obj.mailTemplates = {};
28
+ const constants = (obj.parent.crypto.constants ? obj.parent.crypto.constants : require('constants')); // require('constants') is deprecated in Node 11.10, use require('crypto').constants instead.
29
const nodemailer = require('nodemailer');
30
31
function EscapeHtml(x) { if (typeof x == "string") return x.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"').replace(/'/g, '''); if (typeof x == "boolean") return x; if (typeof x == "number") return x; }
32
//function EscapeHtmlBreaks(x) { if (typeof x == "string") return x.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"').replace(/'/g, ''').replace(/\r/g, '<br />').replace(/\n/g, '').replace(/\t/g, ' '); if (typeof x == "boolean") return x; if (typeof x == "number") return x; }
33
34
// Setup mail server
34
- var options = { host: parent.config.smtp.host, secure: (parent.config.smtp.tls == true), tls: { rejectUnauthorized: false } };
35
+ var options = { host: parent.config.smtp.host, secure: (parent.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 } };
36
if (parent.config.smtp.port != null) { options.port = parent.config.smtp.port; }
37
if ((parent.config.smtp.user != null) && (parent.config.smtp.pass != null)) { options.auth = { user: parent.config.smtp.user, pass: parent.config.smtp.pass }; }
38
obj.smtpServer = nodemailer.createTransport(options);
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.4.0-i",
3
+ "version": "0.4.0-j",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",