From c372afd390f65494d86ec21a339d88beec8f66b6 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Thu, 23 Nov 2023 14:33:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B5=20Added=20logs=20to=20check=20if?= =?UTF-8?q?=20secure=20is=20enable=20(#276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/core/platform/services/email-pusher/index.ts | 9 ++++----- .../src/core/platform/services/email-pusher/types.ts | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts b/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts index 3900ad4b..4e40923d 100644 --- a/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts +++ b/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts @@ -45,10 +45,6 @@ export default class EmailPusherClass port: this.configuration.get("smtp_port", 25), requireTLS: this.configuration.get("smtp_tls", false), secure: this.configuration.get("smtp_tls", false), - auth: { - user: this.configuration.get("smtp_user", ""), - pass: this.configuration.get("smtp_password", ""), - }, }; this.transporter = nodemailer.createTransport(smtpConfig); this.sender = this.configuration.get("smtp_from", ""); @@ -148,7 +144,10 @@ export default class EmailPusherClass this.logger.info("Message sent: %s", info.response); } catch (err) { - this.logger.error({ error: `${err}` }, "Failed to send email"); + this.logger.error( + { error: `${err}`, secure: this.configuration.get("smtp_tls", false) }, + "Failed to send email", + ); } } else { this.logger.info("sending email via api interface."); diff --git a/tdrive/backend/node/src/core/platform/services/email-pusher/types.ts b/tdrive/backend/node/src/core/platform/services/email-pusher/types.ts index 0e63afb6..f97398dd 100644 --- a/tdrive/backend/node/src/core/platform/services/email-pusher/types.ts +++ b/tdrive/backend/node/src/core/platform/services/email-pusher/types.ts @@ -51,7 +51,7 @@ export type SMTPClientConfigType = { port: number; secure?: boolean; requireTLS: boolean; - auth: { + auth?: { user: string; pass: string; };