<div dir="ltr"><div class="inbox-inbox-post-text">
<p>Hello,</p><p>We are using nginx 1.7.3 as a reverse proxy for our Mail SMTP
service. For authentication of each SMTP connection, we have configured
nginx to connect with a http based service for authentication. Here is a
snippet of our nginx config:</p>
<pre><code>mail {
# auth_server
auth_http auth_host:auth_port/authserver;
# mail server
server {
protocol smtp;
listen 25;
proxy on;
xclient on;
timeout 15;
starttls on;
... other configs...
}
}
</code></pre>
<p>With above config, we notice that nginx closes the connection after
every auth request/response to Mail Authentication Server (auth_http
auth_host:auth_port/authserver;) based on tcpdump analysis. We would
like to make this connection persistent so that we could reuse
connection for multiple auth requests. </p>
<p>I looked at nginx mail auth module documentation (<a href="http://nginx.org/en/docs/mail/ngx_mail_auth_http_module.html#auth_http_header" rel="nofollow noreferrer">http://nginx.org/en/docs/mail/ngx_mail_auth_http_module.html#auth_http_header</a> ) but I don't see any directive to make mail auth connection persistent.</p>
<p>I also looked at ngx_http_upstream_module (<a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive" rel="nofollow noreferrer">http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive</a>) which has "keepalive" directive but my understanding is this directive is for http upstream server not for mail auth server.</p>
<p>Can someone please help? Thanks! <br></p>
</div></div>