Starting from nginx 1.19.4 it support auth proxy-pass to the backend: https://github.com/nginx/nginx/commit/1e92a0a4cef98902aed35d7b402a6a402951aba4 http://nginx.org/en/docs/mail/ngx_mail_proxy_module.html#proxy_smtp_auth