SMTP_SECURE option

This commit is contained in:
Ulf Gebhardt 2021-02-15 21:25:35 +01:00
parent 28dd310aa1
commit 8e2d8a77c3
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
2 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,8 @@ const server = {
const smtp = {
SMTP_HOST: env.SMTP_HOST,
SMTP_PORT: env.SMTP_PORT,
SMTP_IGNORE_TLS: env.SMTP_IGNORE_TLS || true,
SMTP_IGNORE_TLS: env.SMTP_IGNORE_TLS === 'true' || true,
SMTP_SECURE: env.SMTP_IGNORE_TLS === 'true' || false,
SMTP_USERNAME: env.SMTP_USERNAME,
SMTP_PASSWORD: env.SMTP_PASSWORD,
}

View File

@ -22,8 +22,8 @@ if (!hasEmailConfig) {
const transporter = nodemailer.createTransport({
host: CONFIG.SMTP_HOST,
port: CONFIG.SMTP_PORT,
ignoreTLS: CONFIG.SMTP_IGNORE_TLS === 'true',
secure: false, // true for 465, false for other ports
ignoreTLS: CONFIG.SMTP_IGNORE_TLS,
secure: CONFIG.SMTP_SECURE, // true for 465, false for other ports
auth: hasAuthData && {
user: CONFIG.SMTP_USERNAME,
pass: CONFIG.SMTP_PASSWORD,