mail: switch from deprecated TLS usage to STARTTLS

This commit is contained in:
Alice Gaudon 2020-07-20 11:29:10 +02:00
parent fe772c4e14
commit 6618e874e0
2 changed files with 5 additions and 5 deletions

View File

@ -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'),

View File

@ -8,11 +8,11 @@ export default class MailComponent extends ApplicationComponent<void> {
public async checkSecuritySettings(): Promise<void> {
// if (!config.get<boolean>('mail.secure')) {
// throw new SecurityError('Cannot set mail.secure to false');
// }
if (!config.get<boolean>('mail.secure')) {
throw new SecurityError('Cannot set mail.secure (starttls) to false');
}
if (config.get<boolean>('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');
}
}