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'); } }