1 (edited by sionalot 2018-04-15 23:58:48)

Topic: Roundcube: 'Unable to connect to managesieve server'

iRedMail 0.9.8
OS: FreeBSD 11.1 (Not in jail)
RAM: Tons - 8GB+
Web server: Nginx
Database: MySQL
Error: 'Unable to connect to managesieve server' when clicking 'Filters' in Roundcube settings

----

Hello,

I'm experiencing issues with Roundcube connecting to the Managesieve plugin on a fresh iRedAdmin solution. When logging into Roundcube, going into settings then clicking 'Filters' I get a 'Unable to connect to managesieve server' error.

This happens on a completely fresh iRedMail 0.9.8 install (+MySQL & Nginx installed by iRedMail installer), installed onto a fresh FreeBSD 11.1 installation (not in a jail). No non-default packages have been installed other than iRedMail. This is also occuring with the default SSL certs provided by iRedMail, I've also changed all the certs out to my own SSL certs but the same issue occurs.

I was wondering if this might be an issue with the machine I was running it on, so I've spun up a FreeBSD 11.1 virtual server on a seperate machine. Installed iRedAdmin and again the same error occurs with default settings (again using MySQL and Nginx)

Sieve is listening on port 4190. I've checked Managesieve's config at /usr/local/www/roundcube/plugins/managesieve/config.inc.php and it is configured to communicate with port 4190 rather than the older port 2000 that older versions used.

It shouldn't make a difference, but I've also tested this with a firewall on and off. Same issue in both scenarios.

I've made sure there is enough RAM for everything to work with - both installs I've tried have had a minimum of 4GB available to them. The problem still continues after disabling and uninstalling Amavisd, ClamAV and SpamAssasin.

What's interesting, is I have a very similar setup (FreeBSD 11.1 with 512MB of RAM, Amavisd, ClamAV and SpamAssasin disabled) which has been running for about a year or two without any issues. The only difference between these setups is the old (working) server is running Apache, but the new server is Nginx, although I don't think that will be causing this issue.The version of iRedAdmin running on the working server is iRedMail 0.9.6.

This issue also seems to cause POP and IMAP connections to not work with SSL. If I disable the need for SSL - POP, IMAP and the Filters section in Roundcube start working again.

As this is happening on two seperate installs without any modifications from myself. Could this be a bug?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube: 'Unable to connect to managesieve server'

*) Is managesieve service running on port 4190? Do you use correct managesieve server address in Roundcube plugin (/usr/local/www/roundcube/plugins/managesieve/config.inc.php)?

*) It sounds like your SSL cert configured in Dovecot is not correct, this causes no SSL/TLS support for all services. please double check.

3

Re: Roundcube: 'Unable to connect to managesieve server'

ZhangHuangbin wrote:

*) Is managesieve service running on port 4190? Do you use correct managesieve server address in Roundcube plugin (/usr/local/www/roundcube/plugins/managesieve/config.inc.php)?

It is listening on that port, and yes the config file is configured to communicate with the correct port.

ZhangHuangbin wrote:

*) It sounds like your SSL cert configured in Dovecot is not correct, this causes no SSL/TLS support for all services. please double check.

The certs do not appear to be the problem. The iRedMail installer correctly configures Dovecot to use its self-signed certs, but the error still occurs. I've also changed the config to use my own LetsEncrypt generated certs - the same issue occurs.

Just to be clear. This problem occurs on two completely separate machines - both with fresh, and completely default FreeBSD 11.1 installs on them - with completely fresh, unmodified iRedMail installations on them with the MySQL and nginx options enabled.

4

Re: Roundcube: 'Unable to connect to managesieve server'

I'm afraid that you have to turn on debug in both Roundcube and Dovecot, then check their log files to get more detailed debug log for troubleshooting.

5

Re: Roundcube: 'Unable to connect to managesieve server'

ZhangHuangbin wrote:

I'm afraid that you have to turn on debug in both Roundcube and Dovecot, then check their log files to get more detailed debug log for troubleshooting.

I've enabled Dovecot and Roundcube debugging and re-tested.

Dovecot doesn't add anything into debug.log when I click onto 'Filters' and the error is presented.

Roundcube does print the below debug output into maillog when I click into 'Filters':

Apr 19 16:10:35 email roundcube: <cvqqesmu> [1] SELECT `vars`, `ip`, `changed`, now() AS ts FROM `session` WHERE `sess_id` = 'cvqqesmubpcaccku43hqk6701i';
Apr 19 16:10:35 email roundcube: <cvqqesmu> [2] SELECT * FROM `users` WHERE `user_id` = '1';

6

Re: Roundcube: 'Unable to connect to managesieve server'

Please check all files under /var/log/dovecot/. Especially "managesieve.log".

7

Re: Roundcube: 'Unable to connect to managesieve server'

ZhangHuangbin wrote:

Please check all files under /var/log/dovecot/. Especially "managesieve.log".

Here's the log output generated by dovecot into /var/log/dovecot.log when I click into 'Filters':

Apr 19 19:01:07 email dovecot: auth-worker(6727): Warning: mysql: Query failed, retrying: Unknown column 'mailbox.enablesievetls' in 'where clause'
Apr 19 19:01:07 email dovecot: auth-worker(6727): Error: sql(postmaster@emaildomainremoved.com,127.0.0.1,<xjWmMThqdW5/AAAB>): Password query failed: Unknown column 'mailbox.enablesievetls' in 'where clause'
Apr 19 19:01:09 email dovecot: managesieve-login: Aborted login (auth service reported temporary failure): user=<postmaster@emaildomainremoved.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, TLS, session=<xjWmMThqdW5/AAAB>

8

Re: Roundcube: 'Unable to connect to managesieve server'

Run SQL commands below as SQL root user:

USE vmail;
ALTER TABLE mailbox ADD COLUMN enablesievetls TINYINT(1) NOT NULL DEFAULT 1;
ALTER TABLE mailbox ADD INDEX (enablesievetls);

9

Re: Roundcube: 'Unable to connect to managesieve server'

ZhangHuangbin wrote:

Run SQL commands below as SQL root user:

USE vmail;
ALTER TABLE mailbox ADD COLUMN enablesievetls TINYINT(1) NOT NULL DEFAULT 1;
ALTER TABLE mailbox ADD INDEX (enablesievetls);

Thanks Zhang, that has resolved the issue.

This is occurring on fresh installs of 0.9.8 with MySQL enabled - this may be something that needs to be rectified with the installer as I suspect I won't be the only one experiencing this issue. It might be specific to FreeBSD 11.1 and the version of MySQL in the ports tree.

10

Re: Roundcube: 'Unable to connect to managesieve server'

iRedMail-0.9.8 has been repacked with this fix. smile
Also the upgrade tutorial for iRedMail-0.9.7 has this fix.

sionalot wrote:

It might be specific to FreeBSD 11.1 and the version of MySQL in the ports tree.

It's related to Dovecot-2.3.