nginx as an IMAP proxy

André Rodier andre at
Thu Apr 18 09:55:24 UTC 2019


I have a question for nginx masters.

I am using Debian Stretch, with Dovecot as a mail server, and two 
webmails, Roundcube and SOGo. Roundcube is configured to pass the ID 
command with the original IP address 'ID ( "x-originating-ip" 
xx.xx.xx.xx )', so Dovecot logs the remote IP correctly, and not So, I know my set-up us working fine.

However, there is a bug in SOGo, because the command is sent only after 
authentication, and Dovecot logs the remote IP as

Is there any way, by using nginx as an IMAP proxy, to inject the remote 
IP address, from an environment variable, passed by the nginx instance 
that serves the web frontend?

   rip=                                  ID ( 
[nginx web frontend]   =>   [Sogo backend]   =>            [  nginx IMAP 
proxy  ]           =>    [Dovecot IMAP server]

I have raised the bug on the SOGo web site, but I think it will be long 
to fix, and I prefer to avoid recompiling the SOGo source code.

Thanks for your help and your ideas,

More information about the nginx mailing list