From 00c11cb2577f26b636fe806a730fdec7fce79ccb Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:41:15 -0500 Subject: [PATCH] fix: remap logger to our own for transporter (per https://github.com/nodemailer/nodemailer/issues/1489) --- app/models/emails.js | 5 ++++- helpers/get-transporter.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/emails.js b/app/models/emails.js index 3c0d1c43d0..0a9b195b84 100644 --- a/app/models/emails.js +++ b/app/models/emails.js @@ -50,9 +50,12 @@ const BYTES_15MB = bytes('15MB'); const transporter = nodemailer.createTransport({ streamTransport: true, - buffer: true + buffer: true, + logger: true }); +transporter.logger = logger; + const scanner = new SpamScanner({ logger, clamscan: env.NODE_ENV === 'test' diff --git a/helpers/get-transporter.js b/helpers/get-transporter.js index d9525b2a04..6ba72dded2 100644 --- a/helpers/get-transporter.js +++ b/helpers/get-transporter.js @@ -207,7 +207,7 @@ async function getTransporter(connectionMap = new Map(), options = {}, err) { : {}), secure: false, secured: false, - logger, + logger: true, // NOTE: we remap this to our own logger below host: mx.host, port: mx.port, connection: mx.socket, @@ -218,6 +218,9 @@ async function getTransporter(connectionMap = new Map(), options = {}, err) { tls }); + // remap because shared logger does not use logger properly + transporter.logger = logger; + const pool = { truthSource, mx,