Koozali.org formerly Contribs.org

[ SOLVED ] Roundcube IMAP Connection issue

Offline Bud

  • ****
  • 431
[ SOLVED ] Roundcube IMAP Connection issue
« on: August 09, 2018, 02:44:20 AM »
guys please can you help

using SME 9.2

installed roundcube contrib as per https://wiki.contribs.org/RoundCube

i have disabled webmail in server console
when i try to login with any user credentials i get " Connection to IMAP server failed "

i have checked the imap service and it is running

generic " HORDE " webmail client works when i " ENABLE " webmail in server console

any help greatly appreciated  :-)
« Last Edit: August 15, 2018, 06:10:13 AM by Bud »

Re: Roundcube IMAP Connection issue
« Reply #1 on: August 11, 2018, 12:49:31 AM »
I don't have Roundcube installed, so not experienced with it, but just a quick check, did you complete this step?

Customize Roundcube settings
Code: [Select]
ls /etc/e-smith/templates/etc/roundcubemail/config.inc.php/
10SQL_DATABASE  20LOGGING_DEBUGGING  30IMAP  40SMTP  50LDAP  60SYSTEM  70USER_INTERFACE  80ADDRESSBOOKS_SETTINGS  90USER_PREFERENCES  95PLUGINS  template-begin  template-end
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline Bud

  • ****
  • 431
Re: Roundcube IMAP Connection issue
« Reply #2 on: August 12, 2018, 08:59:22 AM »
calisun thank you for helping

when i do:
# ls /etc/e-smith/templates/etc/roundcubemail/config.inc.php/
10SQL_DATABASE  20LOGGING_DEBUGGING  30IMAP  40SMTP  50LDAP  60SYSTEM  70USER_INTERFACE  80ADDRESSBOOKS_SETTINGS  90USER_PREFERENCES  95PLUGINS  template-begin  template-end

when i try to login with any user credentials i get " Connection to IMAP server failed "

same issue

any ideas?  :-)



Offline ReetP

  • *
  • 1,667
Re: Roundcube IMAP Connection issue
« Reply #3 on: August 12, 2018, 11:09:12 AM »
Check the contents of your actual config file:

Code: [Select]
cat /etc/roundcubemail/config.inc.php

What is in the IMAP section?

(I think the conf is there for SME v9 but was somewhere in /opt for SME v8)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Bud

  • ****
  • 431
Re: Roundcube IMAP Connection issue
« Reply #4 on: August 12, 2018, 06:38:57 PM »
ReetP thank you for your input

the roundcube config.php

// ----------------------------------
// 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'] = 'ssl://myserver.com';


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


// 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;

// IMAP connection timeout, in seconds. Default: 0 (use default_socket_timeout)
$config['imap_timeout'] = 0;

// Optional IMAP authentication identifier to be used as authorization proxy
$config['imap_auth_cid'] = null;

// Optional IMAP authentication password to be used for imap_auth_cid
$config['imap_auth_pw'] = null;

// If you know your imap's folder delimiter, you can specify it here.
// Otherwise it will be determined automatically
$config['imap_delimiter'] = null;

// If IMAP server doesn't support NAMESPACE extension, but you're
// using shared folders or personal root folder is non-empty, you'll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. "INBOX."
// (special directory "~" is an exception to this rule)
// These can be used also to overwrite server's namespaces
$config['imap_ns_personal'] = null;
$config['imap_ns_other']    = null;
$config['imap_ns_shared']   = null;

// By default IMAP capabilities are readed after connection to IMAP server
// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
// after login. Set to True if you've got this case.
$config['imap_force_caps'] = false;

// By default list of subscribed folders is determined using LIST-EXTENDED
// extension if available. Some servers (dovecot 1.x) returns wrong results
// for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225
// Enable this option to force LSUB command usage instead.
// Deprecated: Use imap_disabled_caps = array('LIST-EXTENDED')
$config['imap_force_lsub'] = false;

// Some server configurations (e.g. Courier) doesn't list folders in all namespaces
// Enable this option to force listing of folders in all namespaces
$config['imap_force_ns'] = false;

// List of disabled imap extensions.
// Use if your IMAP server has broken implementation of some feature
// and you can't remove it from CAPABILITY string on server-side.
// For example UW-IMAP server has broken ESEARCH.
// Note: Because the list is cached, re-login is required after change.
$config['imap_disabled_caps'] = array();

// Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'.
$config['imap_cache'] = null;

// Enables messages cache. Only 'db' cache is supported.
// This requires an IMAP server that supports QRESYNC and CONDSTORE
// extensions (RFC7162). See synchronize() in program/lib/Roundcube/rcube_imap_cache.php
// for further info, or if you experience syncing problems.
$config['messages_cache'] = false;

// Lifetime of IMAP indexes cache. Possible units: s, m, h, d, w
$config['imap_cache_ttl'] = '10d';

// Lifetime of messages cache. Possible units: s, m, h, d, w
$config['messages_cache_ttl'] = '10d';

// Maximum cached message size in kilobytes.
// Note: On MySQL this should be less than (max_allowed_packet - 30%)
$config['messages_cache_threshold'] = 50;

Offline ReetP

  • *
  • 1,667
Re: Roundcube IMAP Connection issue
« Reply #5 on: August 12, 2018, 08:55:07 PM »
No IMAP setting there then.

Can you post this if it exists

Code: [Select]
cat /opt/roundcube/config/config.inc.php

Also

Code: [Select]
cat /opt/roundcube/config/defaults.inc.php
Just trying to see where your settings are and what they are.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 1,667
Re: Roundcube IMAP Connection issue
« Reply #6 on: August 13, 2018, 11:30:13 AM »
Ahhh hang on.

Quote
$config['default_host'] = 'ssl://myserver.com';

Did you amend that line prior to pasting here?

It is set by 30IMAP like this

Code: [Select]
{$OUT .= "   \$config['default_host'] = 'ssl://$DomainName';\n";}
So it should have your domain name in there.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 1,667
Re: Roundcube IMAP Connection issue
« Reply #7 on: August 13, 2018, 11:34:24 AM »
PS - you could try copying

/etc/e-smith/templates/etc/roundcubemail/config.inc.php/20LOGGING_DEBUGGING

to

/etc/e-smith/templates-custom/etc/roundcubemail/config.inc.php/20LOGGING_DEBUGGING

Then change these settings in the file:

Code: [Select]
// system error reporting, sum of: 1 = log; 4 = show, 8 = trace
$config['debug_level'] = 1;  << try 4 here

Code: [Select]
// Log IMAP conversation to <log_dir>/imap or to syslog
$config['imap_debug'] = false; << try true here

See what it logs.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Bud

  • ****
  • 431
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #8 on: August 15, 2018, 06:16:26 AM »
calisun and ReetP thank you for your efforts, much appreciated

well i found out what the issue was

i installed the PHP Software Collections contrib " https://wiki.contribs.org/PHP_Software_Collections " quite a while ago and set it to PHP56 ( using server manager )

when i installed Roundcube and tried to login i experienced the " Connection to IMAP server failed " error.

when i set the PHP Version to DEFAULT and then try to login with Roundcube, IT WORKS!!

Thanks again guys  :P

Offline ReetP

  • *
  • 1,667
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #9 on: August 15, 2018, 09:54:34 AM »
Ok, so it is the change in PHP versions that causes the issue.

But that isn't really a fix (this is possibly a bug)

Roundcube should run under php56, and what happens if you have another webapp that requires 5.6, or 7.x ?

Be nice to try and find the issue.

Was there nothing at all in your logs?
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline warren

  • *
  • 258
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #10 on: August 15, 2018, 11:58:29 PM »
Ok, so it is the change in PHP versions that causes the issue.

But that isn't really a fix (this is possibly a bug)

Roundcube should run under php56, and what happens if you have another webapp that requires 5.6, or 7.x ?

Be nice to try and find the issue.

Was there nothing at all in your logs?

I've got sme9.2 with PHP Software collection installed(smeserver-php-scl ) , with the
PHP-mod version for the server set : php56 and roundcube installed.....all works...

The Kicker is that i had the same issue and i "Think" i had to install some additional php56 modules from the @remi-safe  repo.
I cant find my notes at moment.
Damn , getting old, first gotta make notes then cant find them  :(

Offline ReetP

  • *
  • 1,667
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #11 on: August 16, 2018, 12:27:22 AM »
Well done.

Yes you often do need to manually add extra rpms. Sensible to update though. If you get PHP issues most devs will not listen if you are on 5.3 (or 5.4)

Notes... I know the feeling. I make copious ones. And then can't find them :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Bud

  • ****
  • 431
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #12 on: August 16, 2018, 12:51:20 AM »
ReetP this is the error code

Default SME 9.2 PHP is Version = 5.3.3

Just for those that need help
After installing the PHP Software Collections Contrib you will have a menu option " Server Manager > Configurations > PHP-SCL Versions "

when you choose the " PHP-mod version " option and change the PHP Version to either
PHP54
PHP55
PHP56
PHP70
PHP71

RounCube will now give you the " Connection to IMAP server failed " so you cannot login to the webmail system

the RoundCube Error Log shows the following:
IMAP Error: Login failed for bob from 192.0.0.25. Could not connect to ssl://myserver.com:993: Unknown reason in /usr/share/roundcubemail/program/lib/Roundcube/rcube_imap.php on line 198 (POST /webmail/?_task=login?_task=login&_action=login)

is there any other log i need to look at?

hope this helps

Offline ReetP

  • *
  • 1,667
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #13 on: August 16, 2018, 01:11:31 AM »
@Bud,

It would be handy if @Warren pasted which rpms he has installed

Code: [Select]
rpm -qa |grep php56
You can then check and make sure the lists match.

Second you can take a look in both of these for errors:

Code: [Select]
/var/log/messages
Code: [Select]
/var/log/httpd/error_log(and access_log)

Try tailing them in a console as you access the page:

Code: [Select]
tailf /var/log/messages
Let us know and we'll try and get you working :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline warren

  • *
  • 258
Re: [ SOLVED ] Roundcube IMAP Connection issue
« Reply #14 on: August 16, 2018, 09:11:05 PM »
@Bud,

It would be handy if @Warren pasted which rpms he has installed

Code: [Select]
rpm -qa |grep php56
You can then check and make sure the lists match.

Second you can take a look in both of these for errors:

Code: [Select]
/var/log/messages
Code: [Select]
/var/log/httpd/error_log(and access_log)

Try tailing them in a console as you access the page:

Code: [Select]
tailf /var/log/messages
Let us know and we'll try and get you working :-)

Here is the php56* rpms on my system :

Quote
php56-php-pdo-5.6.37-1.el6.remi.x86_64
php56-php-pecl-xattr-1.3.0-1.el6.remi.x86_64
php56-php-pspell-5.6.37-1.el6.remi.x86_64
php56-php-ioncube-loader-10.2.3-1.el6.remi.x86_64
php56-runtime-2.3-1.el6.remi.x86_64
php56-php-pecl-json-post-1.0.1-1.el6.remi.x86_64
php56-php-5.6.37-1.el6.remi.x86_64
php56-php-enchant-5.6.37-1.el6.remi.x86_64
php56-php-mcrypt-5.6.37-1.el6.remi.x86_64
php56-php-common-5.6.37-1.el6.remi.x86_64
php56-php-pear-1.10.5-5.el6.remi.noarch
php56-php-mysqlnd-5.6.37-1.el6.remi.x86_64
php56-php-process-5.6.37-1.el6.remi.x86_64
php56-php-tidy-5.6.37-1.el6.remi.x86_64
php56-php-bcmath-5.6.37-1.el6.remi.x86_64
php56-php-ldap-5.6.37-1.el6.remi.x86_64
php56-php-snmp-5.6.37-1.el6.remi.x86_64
php56-php-soap-5.6.37-1.el6.remi.x86_64
php56-php-imap-5.6.37-1.el6.remi.x86_64
php56-php-gd-5.6.37-1.el6.remi.x86_64
php56-2.3-1.el6.remi.x86_64
php56-php-gmp-5.6.37-1.el6.remi.x86_64
php56-php-xml-5.6.37-1.el6.remi.x86_64
php56-php-pecl-zip-1.15.3-1.el6.remi.x86_64
php56-php-cli-5.6.37-1.el6.remi.x86_64
php56-php-mbstring-5.6.37-1.el6.remi.x86_64
php56-php-intl-5.6.37-1.el6.remi.x86_64
php56-php-pecl-jsonc-1.3.10-1.el6.remi.x86_64