1 (edited by heeter 2019-11-29 11:39:36)

Topic: Roundcube "connection to imap server failed"

Hi all,

I am having issues trying to connect to the mailserver with a fresh install of roundcube 1.4.

Here is the server configurations:

Mailserver:
Ubuntu18, iredmail 0.99, ports 993 incoming & 587 outgoing.
2 domains serving: mail.example1,com, mail.example2.com
IP 192.168.100.17

Webserver
Ubuntu18, nginx, Mysql, PHP7.3, Letsencrypt, roundcube1.4, Rainloop.
IP 192.168.100.18

Everything functioning correctly, Thunderbird, android K9, Evolution, rainloop.

Roundcube can't connect to mailserver.
current config.inc.php

<?php

$config = array();
$config['db_dsnw'] = 'mysql://user:password@localhost/roundcube_db';
$config['default_host'] = array(
  'ssl://mail.example1.com:993' => 'Example1 Secure Webmail',
  'ssl://mail.example2.com:993' => 'Example2 Secure Webmail'
);
$config['smtp_server'] = 'tls://mail.example1.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['product_name'] = 'Webmail';
$config['des_key'] = 'rcmail-!24ByteDESkey';
$config['plugins'] = array(
    'archive',
    'zipdownload',
);
$config['skin'] = 'elastic';

Any assistance will be greatly appreciated, have been trying to figure out this config file for a couple of days already

Regards

2

Re: Roundcube "connection to imap server failed"

- Is Dovecot service (POP3 and IMAP) running?
- Any related error in /var/log/dovecot/dovecot.log (and imap.log)?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3 (edited by heeter 2019-12-01 08:51:02)

Re: Roundcube "connection to imap server failed"

Hi

dovecot error log:

root@mail:/etc/dovecot# service dovecot start
Job for dovecot.socket failed.
See "systemctl status dovecot.socket" and "journalctl -xe" for details.
root@mail:/etc/dovecot# systemctl status dovecot.socket
● dovecot.socket - Dovecot IMAP/POP3 email server activation socket
   Loaded: loaded (/lib/systemd/system/dovecot.socket; disabled; vendor preset: enabled)
   Active: inactive (dead)
   Listen: 0.0.0.0:143 (Stream)
           [::]:143 (Stream)
           0.0.0.0:993 (Stream)
           [::]:993 (Stream)

Nov 30 17:47:03 mail systemd[1]: dovecot.socket: Socket service dovecot.service already active, refusing.
Nov 30 17:47:03 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email server activation socket.
Nov 30 17:47:28 mail systemd[1]: dovecot.socket: Socket service dovecot.service already active, refusing.
Nov 30 17:47:28 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email server activation socket.
Nov 30 17:47:55 mail systemd[1]: dovecot.socket: Socket service dovecot.service already active, refusing.
Nov 30 17:47:55 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email server activation socket.
Nov 30 17:49:14 mail systemd[1]: dovecot.socket: Socket service dovecot.service already active, refusing.
Nov 30 17:49:14 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email server activation socket.
root@mail:/etc/dovecot# journalctl -xe
-- Subject: Unit dovecot.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit dovecot.service has finished starting up.
-- 
-- The start-up result is RESULT.
Nov 30 17:48:38 mail dovecot[3697]: doveconf: Warning: SSLv2 not supported by OpenSSL. Please consider removing it from ssl_protocols.
Nov 30 17:48:38 mail dovecot[3697]: doveconf: Warning: SSLv2 not supported by OpenSSL. Please consider removing it from ssl_protocols.
Nov 30 17:48:38 mail dovecot[3697]: master: Dovecot v2.2.33.2 (d6601f4ec) starting up for pop3, imap, sieve, lmtp (core dumps disabled)
Nov 30 17:48:38 mail dovecot[3718]: doveconf: Warning: SSLv2 not supported by OpenSSL. Please consider removing it from ssl_protocols.
Nov 30 17:48:38 mail dovecot[3718]: config: Warning: SSLv2 not supported by OpenSSL. Please consider removing it from ssl_protocols.
Nov 30 17:49:14 mail systemd[1]: Configuration file /lib/systemd/system/iredapd.service is marked executable. Please remove executable permission bits. Proceeding
Nov 30 17:49:14 mail systemd[1]: Configuration file /lib/systemd/system/iredapd.service is marked world-inaccessible. This has no effect as configuration data is 
Nov 30 17:49:14 mail systemd[1]: dovecot.socket: Socket service dovecot.service already active, refusing.
Nov 30 17:49:14 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email server activation socket.
-- Subject: Unit dovecot.socket has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit dovecot.socket has failed.
-- 
-- The result is RESULT.
lines 2182-2204/2204 (END)

4

Re: Roundcube "connection to imap server failed"

1: Remove '!SSLv2' in /etc/dovecot/dovecot.conf, then restart Dovecot service.
2: Run "service dovecot restart", any error in /var/log/dovecot/dovecot.log?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5 (edited by heeter 2019-12-02 23:22:57)

Re: Roundcube "connection to imap server failed"

Thank you helping me.

this is what I get after removing the SSL2 protocol

root@mail:/home/adminpc# service dovecot start
Job for dovecot.socket failed.
See "systemctl status dovecot.socket" and "journalctl -xe" for details.
root@mail:/home/adminpc# systemctl status dovecot.socket
● dovecot.socket - Dovecot IMAP/POP3 email server activation socket
   Loaded: loaded (/lib/systemd/system/dovecot.socket; disabled; vendor preset: 
   Active: inactive (dead)
   Listen: 0.0.0.0:143 (Stream)
           [::]:143 (Stream)
           0.0.0.0:993 (Stream)
           [::]:993 (Stream)

Nov 30 17:47:28 mail systemd[1]: dovecot.socket: Socket service dovecot.service 
Nov 30 17:47:28 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email ser
Nov 30 17:47:55 mail systemd[1]: dovecot.socket: Socket service dovecot.service 
Nov 30 17:47:55 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email ser
Nov 30 17:49:14 mail systemd[1]: dovecot.socket: Socket service dovecot.service 
Nov 30 17:49:14 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email ser
Nov 30 17:57:26 mail systemd[1]: dovecot.socket: Socket service dovecot.service 
Nov 30 17:57:26 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email ser
Dec 02 08:14:53 mail systemd[1]: dovecot.socket: Socket service dovecot.service 
Dec 02 08:14:53 mail systemd[1]: Failed to listen on Dovecot IMAP/POP3 email ser
lines 1-18/18 (END)
root@mail:/home/adminpc# service dovecot restart
root@mail:/home/adminpc# 

And here is nano /var/log/dovecot/dovecot.log

Dec  2 08:18:30 mail dovecot: master: Warning: Killed with signal 15 (by pid=12771 uid=0 code=kill)
Dec  2 08:18:30 mail dovecot: master: Dovecot v2.2.33.2 (d6601f4ec) starting up for pop3, imap, sieve, lmtp (core dumps disabled)

Still cant connect


Regards

6

Re: Roundcube "connection to imap server failed"

Hi

Still having issues with this, any help would be greatly appreciated.

Regards

7

Re: Roundcube "connection to imap server failed"

- Any error in /var/log/syslog?
- Also, try to start Dovecot service manually from command line, and show us the error message on console:

dovecot -c /etc/dovecot/dovecot.conf

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

8

Re: Roundcube "connection to imap server failed"

Hi

From the var/log/syslog, I have:

Dec  8 06:25:06 mail systemd-resolved[633]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Dec  8 06:25:07 mail systemd-resolved[633]: message repeated 21 times: [ Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.]
# dovecot -c /etc/dovecot/dovecot.conf
Fatal: Dovecot is already running with PID 721 (read from /var/run/dovecot/master.pid)
# 

Regards

9

Re: Roundcube "connection to imap server failed"

Please restart Dovecot service and try the webmail again.
I expect some related error log in /var/log/dovecot/*.log.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

10 (edited by heeter 2019-12-10 00:48:39)

Re: Roundcube "connection to imap server failed"

No errors on any log files, sad

Restarted dovecot twice

Going to go reboot the router, maybe it is there,

Dec  9 09:33:23 mail dovecot: master: Warning: Killed with signal 15 (by pid=6499 uid=0 code=kill)
Dec  9 09:33:23 mail dovecot: master: Dovecot v2.2.33.2 (d6601f4ec) starting up for imap, sieve, lmtp (core dumps disabled)
Dec  9 09:35:27 mail dovecot: master: Warning: Killed with signal 15 (by pid=6643 uid=0 code=kill)
Dec  9 09:35:28 mail dovecot: master: Dovecot v2.2.33.2 (d6601f4ec) starting up for imap, sieve, lmtp (core dumps disabled)

11

Re: Roundcube "connection to imap server failed"

I just realized that you're running Roundcube on another host, not the iRedMail server.
In this case, you must make sure:

- port 143/993 are open in firewall on iRedMail server
- Roundcube config file uses iRedMail server as the IMAP server address.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

12

Re: Roundcube "connection to imap server failed"

I already have it in the roundcube config file:

<?php

$config['db_dsnw'] = 'mysql://user:password@localhost/roundcube';

$config['default_host'] = array(
  'ssl://mail.example.com:993' => 'Webmail',
);

$config['username_domain'] = array(
  'mail.example.com' => 'example.com',
);

$config['smtp_conn_options'] = array(
  'ssl' => array(
    'verify_peer'  => true,
    'verify_depth' => 3,
    'cafile'       => '/etc/letsencrypt/live/example.com/fullchain.pem;',
  ),
);

$config['smtp_server'] = 'tls://%h';

$config['smtp_user'] = '%u';

$config['smtp_pass'] = '%p';

$config['des_key'] = 'XXXXXXXXXXXXXXXXXXXXX';

$config['product_name'] = 'Webmail';

$config['plugins'] = array(
  'archive',
  'zipdownload'
);

$config['language'] = 'en_US';

Now I am getting "Connection to storage server failed" error

roundcube error log:

[10-Dec-2019 15:15:10 -0700]: <dvrhl7kt> IMAP Error: Login failed for user@example.com against mail.example.com from 192.168.1.1. Could not connect to ssl://mail.example.com:993: Unknown reason in /var/www/roundcube/program/lib/Roundcube/rcube_imap.php on line 200 (POST /?_task=login&_action=login)

Don't know where it is getting the 192.168.1.1, The iredmail server is located @ .17 and roundcube webserver is @ .18

13

Re: Roundcube "connection to imap server failed"

OK, please check managesieve server address in plugin config file: /var/www/roundcube/plugins/managesieve/config.inc.php.

$config['managesieve_host'] =

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

14

Re: Roundcube "connection to imap server failed"

It says 'localhost'

What should I put in instead?

Thank you

15

Re: Roundcube "connection to imap server failed"

Use your remote IMAP server address.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee