From 6618e874e04bfcf112616085c059f5f2fd8cf68e Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 20 Jul 2020 11:29:10 +0200 Subject: [PATCH] mail: switch from deprecated TLS usage to STARTTLS --- src/Mail.ts | 2 +- src/components/MailComponent.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mail.ts b/src/Mail.ts index 377ad92..e412617 100644 --- a/src/Mail.ts +++ b/src/Mail.ts @@ -20,7 +20,7 @@ export default class Mail { const transporter = nodemailer.createTransport({ host: config.get('mail.host'), port: config.get('mail.port'), - secure: config.get('mail.secure'), + requireTLS: config.get('mail.secure'), // STARTTLS auth: { user: config.get('mail.username'), pass: config.get('mail.password'), diff --git a/src/components/MailComponent.ts b/src/components/MailComponent.ts index 38fd8b4..18d8998 100644 --- a/src/components/MailComponent.ts +++ b/src/components/MailComponent.ts @@ -8,11 +8,11 @@ export default class MailComponent extends ApplicationComponent { public async checkSecuritySettings(): Promise { - // if (!config.get('mail.secure')) { - // throw new SecurityError('Cannot set mail.secure to false'); - // } + if (!config.get('mail.secure')) { + throw new SecurityError('Cannot set mail.secure (starttls) to false'); + } if (config.get('mail.allow_invalid_tls')) { - throw new SecurityError('Cannot set mail.allow_invalid_tls to true'); + throw new SecurityError('Cannot set mail.allow_invalid_tls (ignore tls failure) to true'); } }