Roundcube SSL connection IMAP Error: Login failed

Viewed 1604

This is probably a reoccurring problem, where you are unable to Login to Roundcube (Connection to storage server failed), due to an IMAP (ssl) connection error.

Many Posts reports this as an IMAP issue, and tells you that this is due to the config/config.inc.php Imap configuration, but are failing to give any proper debugging of the IMAP.

So, this is another post, of the same problem : Unresolved.

Roundcube reports this error:

IMAP Error: Login failed for user@myserver.com against host.myserver.com from IP_ADDRESS. Could not 
connect to ssl://host.myserver.com:993: Unknown reason in 
../lib/Roundcube/rcube_imap.php on line 200 (POST /webmail/?_task=login&_action=login)

I tried this to check if ssl connection to imap was possible:

openssl s_client -connect host.myserver.com:993

And I am able to connect to the IMAP with ssl, but connection ends with :

BYE Too many invalid IMAP commands.

So ... it seem that the ssl certificate is valid, and I am able to connect on port 993.

Roundcube still reports an Unknown reason for not connecting properly.

The certificate was generated by the ./mkcert.sh bash script, where you can enter the proper hostname of your server, to be included in the certificate.

After a lot of debugging, and no proper debugging methodology I found the easy solution, by bypassing ssl verification.

A stupid solution:

$config['imap_conn_options'] = array(
        'ssl' => array(
            'verify_peer' => false,
            'verfify_peer_name' => false,
    ),
);

$config['smtp_conn_options'] = array(
    'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
    ),
);

Do anyone have some suggestions for the next thing to try

Thanks!

0 Answers
Related