From 5422910a6cb1b2e1bdc5b5fd2bd8440b4017748a Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki Date: Tue, 8 Jun 2021 13:26:23 +0000 Subject: [PATCH 1/4] Update mailer.js, added NTLM auth --- config/mailer.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/config/mailer.js b/config/mailer.js index 34751737..012c00c7 100644 --- a/config/mailer.js +++ b/config/mailer.js @@ -1,4 +1,6 @@ -const nodemailer = require('nodemailer') +const nodemailer = require('nodemailer'); +const nodemailerNTLMAuth = require('nodemailer-ntlm-auth'); + var env = process.env.NODE_ENV || 'testing'; const config = require('./config')[env] @@ -8,8 +10,16 @@ var smtpTransport = nodemailer.createTransport({ secure: config.mailer.secureConnection, port: config.mailer.port, auth: { + type: 'custom', + method: 'NTLM', user: config.mailer.authUser, - pass: config.mailer.authPass + pass: config.mailer.authPass, + options: { + domain: 'ad' + } + }, + customAuth:{ + NTLM: nodemailerNTLMAuth } }); @@ -25,4 +35,4 @@ var mailer = { options: mailOptions } -module.exports = mailer \ No newline at end of file +module.exports = mailer -- GitLab From dedbc314695b51f563fcea65b9b55ab11c7fe8cb Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki Date: Tue, 8 Jun 2021 13:27:42 +0000 Subject: [PATCH 2/4] Update mailer.js, added requireTLS --- config/mailer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mailer.js b/config/mailer.js index 012c00c7..d7c6faf0 100644 --- a/config/mailer.js +++ b/config/mailer.js @@ -9,6 +9,7 @@ var smtpTransport = nodemailer.createTransport({ host: config.mailer.host, secure: config.mailer.secureConnection, port: config.mailer.port, + requireTLS: config.mailer.TLS, auth: { type: 'custom', method: 'NTLM', -- GitLab From 6d7dd19fbfa3b05e54899c016a353fbf2ad2da76 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki Date: Tue, 8 Jun 2021 13:29:18 +0000 Subject: [PATCH 3/4] Update config.js TLS settings --- config/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.js b/config/config.js index 3da503db..e4bb457c 100644 --- a/config/config.js +++ b/config/config.js @@ -28,6 +28,7 @@ module.exports = { host: 'mailhost', // hostname secureConnection: false, // TLS requires secureConnection to be false port: 587, // port for secure SMTP + TLS: true, // sets requireTLS authUser: 'mailuser', authPass: 'mailpass', tlsCiphers: 'SSLv3', @@ -66,6 +67,7 @@ module.exports = { host: 'mailhost', // hostname secureConnection: false, // TLS requires secureConnection to be false port: 587, // port for secure SMTP + TLS: true, // sets requireTLS authUser: 'mailuser', authPass: 'mailpass', tlsCiphers: 'SSLv3', @@ -75,4 +77,4 @@ module.exports = { token_readWriteProjects: 'token-goes-here' } } -} \ No newline at end of file +} -- GitLab From 6142ba2fe213fa413ac62574ae43937e617193ca Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki Date: Tue, 8 Jun 2021 13:34:11 +0000 Subject: [PATCH 4/4] Update package.json, added dependency to nodemailer-ntlm-auth --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 53eff8b2..78d2bb41 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "mysql": "^2.17.1", "mysql2": "^2.2.5", "nodemailer": "^6.3.1", + "nodemailer-ntlm-auth": "^1.0.1", "passport": "0.3.2", "passport-saml": "^2.1.0", "pug": "^3.0.2" -- GitLab