Roundcube Community Forum

Release Support => Pending Issues => Topic started by: grpprod on December 03, 2007, 10:34:14 AM

Title: Roundcube still tries to connect using 143 even it is configured for 993
Post by: grpprod on December 03, 2007, 10:34:14 AM
Hi,
I just installed Roundcube RC2. I configured it with no problems, however I can't connect to my IMAPS server (on another computer). On the same machine, there is another webmail system (which obviously uses the same PHP, Apache and MySQL platform) which can connect to the mail server with no problem whatsoever.

Below I paste the error recorded. Please note: i HAVE configured RoundCube to use SSL (ssl://1.2.3.4:993). I changed the TCP port to 993. However I notice that it still tries to connect using plain IMAP.

[03-Dec-2007 17:26:26 +0200] IMAP Error: Could not connect to 1.2.3.4 at port 143: Connection refused in on line 0
[03-Dec-2007 17:26:31 +0200] IMAP Error: Open SSL not available; in /opt/newwebmail/program/include/rcube_imap.inc on line 0

Any help would be appreciated.
Title: same problem
Post by: bgs on January 21, 2009, 09:00:04 AM
Quote from: grpprod;9641Hi,
...

Below I paste the error recorded. Please note: i HAVE configured RoundCube to use SSL (ssl://1.2.3.4:993). I changed the TCP port to 993. However I notice that it still tries to connect using plain IMAP.


Any update on this? I have the same problem. I have multiple servers (pull down menu on login page). Most servers are 143 and I have one with ssl://server:993
The later doesn't work as it tries to connect to port 143 despite the explicit 993 setting. It seems that the default 143 port set because of the others 'overrides the 993 override' :(

Regards
Bgs

Edit: Using 0.2 stable, but had the same error with the beta and 0.1
Title: Roundcube still tries to connect using 143 even it is configured for 993
Post by: rosali on January 21, 2009, 10:08:33 AM
The reason why it did not work for "grpprod" (very old post) seems to be due to that PHP was compiled without OpenSSL support:


Open SSL not available; in /opt/newwebmail/program/include/rcube_imap.inc on line 0
Title: Roundcube still tries to connect using 143 even it is configured for 993
Post by: bgs on January 21, 2009, 10:35:16 AM
Quote from: rosali;16553The reason why it did not work for "grpprod" (very old post) seems to be due to that PHP was compiled without OpenSSL support:


Open SSL not available; in /opt/newwebmail/program/include/rcube_imap.inc on line 0

Then this is different...


$rcmail_config['default_host'] = array('bgs','21s','ssl://gm:993');
$rcmail_config['default_port'] = 143;


I use /etc/hosts entries to 1) make pull down box shorted 2) don't want imap nodes to be too obvious for strangers.

As you see the default port is 143 as the first two servers run on imap:143. The last one runs on imaps:993, so I explicitly added :993 to it.

Result:


[21-Jan-2009 14:28:13 +0100] IMAP Error: Could not connect to gm at port 143: Connection timed out (POST /?_task=&_action=login)


Any ideas?

Regards
Bgs
Title: Roundcube still tries to connect using 143 even it is configured for 993
Post by: rosali on January 21, 2009, 11:02:18 AM
Can't check it right now, because I'm out of home for a few days.

Just a guess: Have you tried $rcmail_config['default_port'] = array(143,143,993);
Title: Funny result
Post by: bgs on January 21, 2009, 11:43:26 AM
Funny result... the :993 connection does work now, but the normal :143 ones stopped working...


Jan 21 17:41:12 mail roundcube: PHP Warning:  fsockopen() expects parameter 2 to be long, array given in /net/www/bgs/webmail.bgs.hu/program/lib/imap.inc on line 596
Jan 21 17:41:13 mail roundcube: [21-Jan-2009 17:41:12 +0100] IMAP Error: Could not connect to bgs at port Array:  (POST /?_task=&_action=login)


It wants to connecto to port 'Array' :D
Title: Roundcube still tries to connect using 143 even it is configured for 993
Post by: rosali on January 22, 2009, 05:22:46 AM
Do you have basic PHP knowledge?

If so, open ./program/include/rcmail.php and find ...


    // parse $host URL
    $a_host = parse_url($host);
    if ($a_host['host']) {
      $host = $a_host['host'];
      $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
      $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $config['default_port']);
    }
    else
      $imap_port = $config['default_port'];


... and enter some debug code after $host URL is parsed, e.g.: echo "
";print_r($a_host); This should lead you to the reason why it defaults to 'default_port'.