Outgoing request proxy


I have my site (inbound) behind a DDoS protection reverse proxy. However, when the forum crawls images to download and when emails are sent, the backend host is exposed and hit (ex: user signs up and looks at email headers in the welcome message)

Is it possible to set some kind of PROXY= envvar with either a http/s connect or SOCKS5 that will be respected by whatever socket library discourse uses?