diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index b62db9d4..a3d5c6a7 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -54,6 +54,7 @@ services: # - SMTP_USER= # - SMTP_PASSWORD= # - SMTP_FROM="Demo Demo" + # - SMTP_TLS_REJECT_UNAUTHORIZED=false # Optional fields: accessToken, events, excludedEvents # - | diff --git a/docker-compose.yml b/docker-compose.yml index d825cbac..e3a4bfde 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,6 +61,7 @@ services: # - SMTP_USER= # - SMTP_PASSWORD= # - SMTP_FROM="Demo Demo" + # - SMTP_TLS_REJECT_UNAUTHORIZED=false # Optional fields: accessToken, events, excludedEvents # - | diff --git a/server/.env.sample b/server/.env.sample index 28be92ff..8393b1db 100644 --- a/server/.env.sample +++ b/server/.env.sample @@ -53,6 +53,7 @@ SECRET_KEY=notsecretkey # SMTP_USER= # SMTP_PASSWORD= # SMTP_FROM="Demo Demo" +# SMTP_TLS_REJECT_UNAUTHORIZED=false # Optional fields: accessToken, events, excludedEvents # WEBHOOKS='[{ diff --git a/server/api/hooks/smtp/index.js b/server/api/hooks/smtp/index.js index dd9ca8df..64aa8641 100644 --- a/server/api/hooks/smtp/index.js +++ b/server/api/hooks/smtp/index.js @@ -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, + }, }); }, diff --git a/server/config/custom.js b/server/config/custom.js index 44a72a14..c10cf5ed 100644 --- a/server/config/custom.js +++ b/server/config/custom.js @@ -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