We have a production server running a singlepage web-app and a separate proxy server, for security reasons. Every request to our web-app is handled by our reverse proxy (nginx) on the proxy server. So the IP adress of our production server is never visible to outsiders.
Now we need to send (not get) emails from our production server via nodemailer. We would like to send it to mail.proxyserver.com and he should pass it to a new adress. We did this already for normal https request and were able to use header variables to determine the proxy_pass adress (proxy_pass https://$http_target_ip;
)
Is it possible to reverse-proxy outgoing emails via nginx, so that a server can send emails over a proxy ithout being visible himself?
How would the config for this need to look like when sending Emails via smtp over a standard port?
I took a look at the nginx documentation and various forum posts but atm I cant get bring it together...