I successfully set up nginx imap/pop3 mail proxy with auth_http which has been working fine for months.
Recently came up a request on showing client's IP in mail.log at imap logins.
Since Nginx communicates with Dovecot the IP address in log belongs to Nginx server (which in this case 127.0.0.1 – as they are on the same server).
So far I could not find a solution or workaround for that.
Apparently not even logging is possible in nginx mail block.
The closest hit was a HAProxy support in Dovecot (https://wiki2.dovecot.org/HAProxy) but I am not sure there is similar to Nginx.
Any help is appreciated.
Thanks
Best Answer
Workaround
Not finding suitable solution I rather created a new log file in the proxy script which provided a acceptable solution to the request.
Here is the excerpt:
It might help someone.