Nginx SMTP relay access denied!

shahzaib mushtaq shahzaib.cb at
Fri Dec 20 11:29:38 UTC 2019


We've setup NGINX SMTP proxy in front of postfix. When i try to telnet to
nginx smtp on port 25 it shows the "relay access denied" message.:

 Here is the config of nginx:

mail {

        auth_http localhost:80/auth.php;
        proxy_pass_error_message on;
        server {
                listen 25;
                protocol smtp;
                timeout 300s;
                proxy on;
                xclient off;
                smtp_auth none plain;
        #       auth_http_header HTTP_AUTH_USER Auth-User;
        #       auth_http_header HTTP_AUTH_PASS Auth-Pass;
                smtp_capabilities "AUTH PLAIN";


Following is the content of auth.php that we're using :

What we want is that, any user tries to connect to Nginx SMTP proxy to send
email should be authenticated to backend. Is that possible?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list