Skip to content

Commit

Permalink
fix: remap logger to our own for transporter (per nodemailer/nodemail…
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Sep 13, 2023
1 parent 7b00438 commit 00c11cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/models/emails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion helpers/get-transporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 00c11cb

Please sign in to comment.