Skip to content

Commit

Permalink
feat: Ability to disable SMTP certificate verification
Browse files Browse the repository at this point in the history
Closes #744
  • Loading branch information
meltyshev committed Oct 2, 2024
1 parent 5f6528f commit 8929235
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ services:
# - SMTP_USER=
# - SMTP_PASSWORD=
# - SMTP_FROM="Demo Demo" <[email protected]>
# - SMTP_TLS_REJECT_UNAUTHORIZED=false

# Optional fields: accessToken, events, excludedEvents
# - |
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ services:
# - SMTP_USER=
# - SMTP_PASSWORD=
# - SMTP_FROM="Demo Demo" <[email protected]>
# - SMTP_TLS_REJECT_UNAUTHORIZED=false

# Optional fields: accessToken, events, excludedEvents
# - |
Expand Down
1 change: 1 addition & 0 deletions server/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ SECRET_KEY=notsecretkey
# SMTP_USER=
# SMTP_PASSWORD=
# SMTP_FROM="Demo Demo" <[email protected]>
# SMTP_TLS_REJECT_UNAUTHORIZED=false

# Optional fields: accessToken, events, excludedEvents
# WEBHOOKS='[{
Expand Down
3 changes: 3 additions & 0 deletions server/api/hooks/smtp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ module.exports = function defineSmtpHook(sails) {
user: sails.config.custom.smtpUser,
pass: sails.config.custom.smtpPassword,
},
tls: {
rejectUnauthorized: sails.config.custom.smtpTlsRejectUnauthorized,
},
});
},

Expand Down
1 change: 1 addition & 0 deletions server/config/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module.exports.custom = {
smtpUser: process.env.SMTP_USER,
smtpPassword: process.env.SMTP_PASSWORD,
smtpFrom: process.env.SMTP_FROM,
smtpTlsRejectUnauthorized: process.env.SMTP_TLS_REJECT_UNAUTHORIZED !== 'false',

webhooks: JSON.parse(process.env.WEBHOOKS || '[]'), // TODO: validate structure

Expand Down

0 comments on commit 8929235

Please sign in to comment.