[RCD] IMAP ID Bug found in Roundcube 1.0.1 in rcube_imap.php

Benoit Panizzon benoit.panizzon at imp.ch
Thu Nov 6 16:22:26 CET 2014


I habe been desperately trying to get Roundcube to send the correct 
REMOTE_ADDR of the connecting client to a dovecot IMAP Server which supports 
remote IP logging by x-originating-ip ID command and login_trusted_networks 
As google shows, that not only I had this problems, I share the solution and 
hope one of the developers reading here could submit that small fix:

Here are the changes needed for it to work

rcube_imap.php, define the ident option not only if debugging is enabled, and 
add x-originating-ip to the array.

        if ($this->options['debug']) {
        } // <= Added

            $this->options['ident'] = array(
                'name'    => 'Roundcube',
                'version' => RCUBE_VERSION,
                'php'     => PHP_VERSION,
                'os'      => PHP_OS,
                'x-originating-ip'      => $_SERVER['REMOTE_ADDR'], // <=Added
                'command' => $_SERVER['REQUEST_URI'],
//        }

Now this works as expected and dovecot (including it's post-login script) are 
getting the IP of the connecting webbrowser and not the one of the webserver, 
if the webserver's IP is in login_trusted_networks.

Benoit Panizzon
I m p r o W a r e   A G    -    

Zurlindenstrasse 29             Tel  +41 61 826 93 07
CH-4133 Pratteln                Fax  +41 61 826 93 02
Schweiz                         Web  http://www.imp.ch

More information about the dev mailing list