• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Roundcube stoped working "Connection to imap server failed"

Bart_NL

Basic Pleskian
TITLE:
Roundcube stoped working "Connection to imap server failed"
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
CentOS Linux 7.4.1708 (Core)‬
Plesk Onyx Version 17.8.5
Roundcube (1.2.5)
PROBLEM DESCRIPTION:
Hi,

It's not possible to log on to webmail trough the use of Roundcube. Roundcube will give a notification that the "Connection to imap server failed".

I read online somewhere that it might has something to do with php 5.6? but im not sure how to test that. Also Horde works as expected.​
STEPS TO REPRODUCE:
Go to https://webmail.example.com en try to login​
ACTUAL RESULT:
Error with debug set to 4:
Code:
Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap_generic.php on line 949

Warning: stream_socket_client(): Failed to enable crypto in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap_generic.php on line 949

Warning: stream_socket_client(): unable to connect to ssl://localhost:993 (Unknown error) in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap_generic.php on line 949
IMAP Error in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap.php (193): Login failed for [email protected] from xx.xx.xx.xx(X-Real-IP: xx.xx.xx.xx). Could not connect to ssl://localhost:993: Unknown reason
EXPECTED RESULT:
Able to login​
ANY ADDITIONAL INFORMATION:
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Confirm bug
 
Hi Bart_NL,

pls. include your "config.inc.php" from "/usr/share/psa-roundcube/config" as attachment for further investigations.
 
Hi,

Sure, I removed the username and password of the config.inc.php
And the debug I placed there myself so I would have more information

Code:
<?php
// Copyright 1999-2017. Plesk International GmbH. All rights reserved.
$config = array();
$config['db_dsnw'] = 'mysql://user:password@localhost/roundcubemail';
$config['debug_level'] = 4;
 
args... sorry... my fault.... pls. include as attachment for further investigations:

"defaults.inc.php" from "/usr/share/psa-roundcube/config"
 
No problem,

Hereby, I changed it to .txt to upload it.
I never changed it, so it sould be default from installing 17.8.5
 

Attachments

  • defaults.inc.php.txt
    50.9 KB · Views: 20
Hi Bart_NL,

pls. make a backup of your "defaults.inc.php" and consider to change afterwards:

Code:
$config['smtp_server'] = 'ssl://localhost';
to
Code:
$config['smtp_server'] = 'tls://localhost';

I addition, I recommend to setup:
Code:
$config['smtp_server'] = 'ssl://localhost';
to
Code:
$config['smtp_server'] = 'tls://localhost';

and
Code:
$config['smtp_port'] = 465;
to
Code:
$config['smtp_port'] = 587;

Pls. report back with your new test - result, when trying to login.
 
For the first smtp_server I think you mean the default server? correct?

I changed the config to and also see file attaced:
Code:
$config['default_host'] = 'tls://localhost';
$config['smtp_server'] = 'tls://localhost';
$config['smtp_port'] = 587;

Now I get a code 500, Internal Server Error
But no entry in /var/log/plesk-roundcube/errors
 

Attachments

  • defaults.inc.php.txt
    50.9 KB · Views: 7
Hi Bart_NL,

you stated:
I never changed it, so it sould be default from installing 17.8.5
... but if I look at standart installations, I see:
Code:
...

// ----------------------------------
// IMAP
// ----------------------------------

// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
//          required to match old user data records with the new host.
$config['default_host'] = 'localhost';
@include "/etc/psa-webmail/roundcube/mailhosts.php";

// TCP port used for IMAP connections
$config['default_port'] = 143;

.....
and
Code:
...

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or null to use
// best server supported one)
$config['imap_auth_type'] = null;

// IMAP socket context options
// See http://php.net/manual/en/context.ssl.php
// The example below enables server certificate validation
//$config['imap_conn_options'] = array(
//  'ssl'         => array(
//     'verify_peer'  => true,
//     'verify_depth' => 3,
//     'cafile'       => '/etc/openssl/certs/ca.crt',
//   ),
// );
$config['imap_conn_options'] = null;

...
and
Code:
...

// ----------------------------------
// SMTP
// ----------------------------------

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = 'localhost';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 25;

...
( but on standart Debian/Ubuntu - based systems )
 
Im using a CentOS system. I havent changed the files.
I did set up SSL certificate from the Plesk GUI but when you asked me to open the file it was the first time i've opened it..

I'll try the changes als you displayed now
 
Oké, now it works, see file.

Still strange that I haven't changed anything in this file, the first file I send was how the file was after the initial installation and my default settings via the Plesk GUI.
Thats why I reported it as a bug, when changing config myself I wouldn't sent it in a a bug.

I can work now, thanks!
 

Attachments

  • defaults.inc.php.txt
    50.9 KB · Views: 72
Hi Bart_NL,

there is still the possibility, that you hit a bug, as the Plesk developers have to investigate, why you experienced the described issue, even that you didn't touch the config - files manually. :)
 
Had the update to #Plesk Onyx 17.8 Preview 8 and roundcube didnt work anymore...

Same issue, most be something with de default config file becauce it was overwritten...
 
If you only use Roundcube as a webmail (without other functionalities), I recommend you to take a look on RainLoop Webmail or WebMail Lite 8 (Beta).
You can easily install them on the subdomain of your choice and register them as additional webmails in Plesk. Both of them are just awesome compared to roundcube

Thanks for the information! Wil take a look at RainLoop, it looks quite nice.

However, that still doenst resolve the bug with roundcube that the plesk developers has to check and fix. :)
 
Same error with 17.8.11 Update 1 here and also the same results when trying to fix it.
 
Last edited:
Back
Top