Skip to content

Commit

Permalink
Fixed SMTP_SECURE type check within variables.js. Removed smtpSecure …
Browse files Browse the repository at this point in the history
…checks from mail.js. Disable TLS certificate checks within mail.js since this could cause issues with self-hosted solutions
  • Loading branch information
glenndehaan committed Oct 8, 2024
1 parent ac6f10d commit 9b48a97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9b48a97

Please sign in to comment.