Fixed SMTP_SECURE type check within variables.js. Removed smtpSecure checks from mail.js. Disable TLS certificate checks within mail.js since this could cause issues with self-hosted solutions

This commit is contained in:
Glenn de Haan
2024-10-08 10:24:45 +02:00
parent ac6f10de91
commit 9b48a97136
2 changed files with 5 additions and 2 deletions

View File

@@ -24,7 +24,10 @@ const bytes = require('../utils/bytes');
const transport = nodemailer.createTransport({
host: variables.smtpHost,
port: parseInt(variables.smtpPort),
secure: (variables.smtpSecure === 'true' || variables.smtpSecure === true),
secure: variables.smtpSecure,
tls: {
rejectUnauthorized: false // Skip TLS Certificate checks for Self-Hosted systems
},
auth: {
user: variables.smtpUsername,
pass: variables.smtpPassword

View File

@@ -37,7 +37,7 @@ module.exports = {
smtpFrom: config('smtp_from') || process.env.SMTP_FROM || '',
smtpHost: config('smtp_host') || process.env.SMTP_HOST || '',
smtpPort: config('smtp_port') || process.env.SMTP_PORT || 25,
smtpSecure: config('smtp_secure') || process.env.SMTP_SECURE || false,
smtpSecure: config('smtp_secure') || (process.env.SMTP_SECURE === 'true') || false,
smtpUsername: config('smtp_username') || process.env.SMTP_USERNAME || '',
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info',