In my organization we are migrating a certain web+mail setup, and I think that maybe nginx can be suited to do what I want, but I cannot fully understand the official documentation.

I have a certain web application (in-house) at machine A, with a set of users. The machine A is capable to send mails as *

I want to allow some users to send mails as, but not as (certain users share some groups, and a user has several allowed groups). Can I set the nginx to authenticate the user against a certain URL, and allow or disallow a certain user depending on the MAIL FROM field?

If I can receive a request just like one of the last examples (same link):

GET /auth HTTP/1.0
Host: localhost
Auth-Method: none
Auth-Protocol: smtp
Auth-Login-Attempt: 1
Auth-SMTP-From: MAIL FROM: <>
Auth-SMTP-To: RCPT TO: <>

I could take good decisions from the web application... provided that this works when authentication is not none. But when authentication is something ( LOGIN or PLAIN), I don't know if the Auth-SMTP-From will be sent to auth_http.

Am I on the right track? Can it be done? Is there another way? A better way?

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.