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 *@example.net.

I want to allow some users to send mails as certain_group@example.net, but not as user@example.net (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
Client-Host: client.example.org
Auth-SMTP-Helo: client.example.org
Auth-SMTP-From: MAIL FROM: <>
Auth-SMTP-To: RCPT TO: <postmaster@mail.example.com>

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 agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.