Author Topic: Roundcube still tries to connect using 143 even it is configured for 993  (Read 5283 times)

Offline grpprod

  • Full Member
  • ***
  • Posts: 53
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.

Code: [Select]
[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.

Offline bgs

  • Newbie
  • *
  • Posts: 3
same problem
« Reply #1 on: January 21, 2009, 09:00:04 AM »
Quote from: grpprod;9641
Hi,
...

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
« Last Edit: January 21, 2009, 09:04:49 AM by bgs »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube still tries to connect using 143 even it is configured for 993
« Reply #2 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:

Code: [Select]

Open SSL not available; in /opt/newwebmail/program/include/rcube_imap.inc on line 0
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline bgs

  • Newbie
  • *
  • Posts: 3
Roundcube still tries to connect using 143 even it is configured for 993
« Reply #3 on: January 21, 2009, 10:35:16 AM »
Quote from: rosali;16553
The reason why it did not work for "grpprod" (very old post) seems to be due to that PHP was compiled without OpenSSL support:

Code: [Select]

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


Then this is different...

Code: [Select]

$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:

Code: [Select]

[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

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube still tries to connect using 143 even it is configured for 993
« Reply #4 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);
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline bgs

  • Newbie
  • *
  • Posts: 3
Funny result
« Reply #5 on: January 21, 2009, 11:43:26 AM »
Funny result... the :993 connection does work now, but the normal :143 ones stopped working...

Code: [Select]

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

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube still tries to connect using 143 even it is configured for 993
« Reply #6 on: January 22, 2009, 05:22:46 AM »
Do you have basic PHP knowledge?

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

Code: [Select]

    // 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.:
Code: [Select]
echo "
";print_r($a_host); This should lead you to the reason why it defaults to 'default_port'.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)