I'm trying to configure NGINX as a Mail Proxy Server using this example: https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/
I came up with this configuration:
mail
{
server_name mail.example.com;
ssl on;
starttls on;
include ssl_settings;
server
{
listen 25;
smtp_auth plain;
# Enables user authentication on the SMTP backend using the AUTH command instead of using the authentication server
proxy_smtp_auth on
server_name smtp.example.com
}
server
{
listen 143;
imap_auth plain;
# Authentication server
auth_http localhost:8080/cgi-bin/nginxauth.cgi;
server_name imap.example.com
}
}
(I don't know how to make the indentation appear correctly as code)
I'm using "proxy_smtp_auth" for SMTP to directly use the SMTP backend authentication mechanism.
I seems that there is no "proxy_imap_auth" to directly use the IMAP backend authentication mechanism.
So I configured "cgi-bin/nginxauth.cgi".instead but I have no idea what its contents should be.
Any suggestion?