From 255cf07b07cf4783ef9304c9c69ac1f81ee68ee5 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Thu, 23 Nov 2023 15:03:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=89=EF=B8=8F=20Email=20SMTP=20Auth=20and?= =?UTF-8?q?=20Logs=20(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Monta --- .../src/core/platform/services/email-pusher/index.ts | 12 +++++++++--- .../src/core/platform/services/email-pusher/types.ts | 2 +- 2 files changed, 10 insertions(+), 4 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 4e40923d..9387c892 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 @@ -43,8 +43,7 @@ export default class EmailPusherClass const smtpConfig: SMTPClientConfigType = { host: this.configuration.get("smtp_host", ""), port: this.configuration.get("smtp_port", 25), - requireTLS: this.configuration.get("smtp_tls", false), - secure: this.configuration.get("smtp_tls", false), + secure: false, }; this.transporter = nodemailer.createTransport(smtpConfig); this.sender = this.configuration.get("smtp_from", ""); @@ -145,7 +144,14 @@ export default class EmailPusherClass this.logger.info("Message sent: %s", info.response); } catch (err) { this.logger.error( - { error: `${err}`, secure: this.configuration.get("smtp_tls", false) }, + { + error: `${err}`, + smtpConfig: { + host: this.configuration.get("smtp_host", ""), + port: this.configuration.get("smtp_port", 25), + secure: false, + }, + }, "Failed to send email", ); } 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 f97398dd..e244deb9 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 @@ -50,7 +50,7 @@ export type SMTPClientConfigType = { host: string; port: number; secure?: boolean; - requireTLS: boolean; + requireTLS?: boolean; auth?: { user: string; pass: string;