feat: Add configurable proxy for outgoing traffic to prevent SSRF

This commit is contained in:
Maksim Eltyshev
2026-02-09 13:33:27 +01:00
parent aa3ebd5add
commit 538280d197
12 changed files with 174 additions and 8 deletions
@@ -23,6 +23,11 @@ module.exports = {
if (config.smtpHost) {
sourceConfig = config;
// TODO: hack to make it work with proxy
if (sourceConfig.smtpPort === null) {
sourceConfig.smtpPort = sourceConfig.smtpSecure ? 465 : 587;
}
}
}
@@ -47,6 +52,10 @@ module.exports = {
tls: {
rejectUnauthorized: sourceConfig.smtpTlsRejectUnauthorized,
},
proxy:
sails.config.custom.outgoingProxy && !sails.config.custom.smtpHost
? sails.config.custom.outgoingProxy
: undefined,
},
{
from: sourceConfig.smtpFrom,