Welcome! Log In Create A New Profile


Re: SMTP Forward Nginx Proxy

Maxim Dounin
November 26, 2015 08:52AM

On Wed, Nov 25, 2015 at 05:27:09PM -0500, chobit wrote:

> Almost all of our customers send e-mail through our private SMTP servers,
> but we have one customer who chooses to use a third-party SMTP provider. The
> third-party SMTP service requires whitelisting of any sending IP addresses
> which is normal.
> Unfortunately the components in our infrastructure which send e-mail are
> part of an autoscaling group so the IP addresses can vary.
> To solve for this problem I would like to setup an nginx configuration which
> accepts SMTP connections to it and then proxies them to another IP address
> (the third-party SMTP service) so the requests to the mail server always
> appear to the third-party SMTP service as if they came from the same
> server.
> Is it possible to solve this issue with ngingx smtp proxy?
> How should i forwarded smtp in case with third-party SMTP service?

You can configure nginx mail proxy to forward all connections to a
particular SMTP server. To do so, return server IP addresss from your
auth_http service, see http://nginx.org/r/auth_http.

Note though, that nginx is not designed to talk to 3rd party
servers, it is designed to proxy to your own backends. In
particular, in case of SMTP this results in the fact that no auth
commands are sent to backend servers - they are expected to be
configured to accept mail without authentification. Depending on
a particular 3rd party service you are trying to use, this may or
may not be an option.

For your particular task, it may be easier to configure raw TCP
proxy to a particular 3rd party SMTP server (e.g., using nginx
stream proxy, http://nginx.org/en/docs/stream/ngx_stream_core_module.html)
or a full-featured STMP server with a smarthost configured.

Maxim Dounin

nginx mailing list
Subject Author Posted

SMTP Forward Nginx Proxy

chobit November 25, 2015 05:27PM

Re: SMTP Forward Nginx Proxy

Maxim Dounin November 26, 2015 08:52AM

Re: SMTP Forward Nginx Proxy

itpp2012 November 26, 2015 09:14AM

Re: SMTP Forward Nginx Proxy

Igor Sysoev February 26, 2019 06:54AM

Re: SMTP Forward Nginx Proxy

Maxim Konovalov February 26, 2019 07:14AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready