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 firstname.lastname@example.org, but not as email@example.com (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-User: Auth-Pass: Auth-Protocol: smtp Auth-Login-Attempt: 1 Client-IP: 192.0.2.42 Client-Host: client.example.org Auth-SMTP-Helo: client.example.org Auth-SMTP-From: MAIL FROM: <> Auth-SMTP-To: RCPT TO: <firstname.lastname@example.org>
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
Am I on the right track? Can it be done? Is there another way? A better way?