Roundcube : Connection to IMAP server failed.

Discussion in 'Installation/Configuration' started by Oitsuki, Jul 20, 2018.

  1. Oitsuki

    Oitsuki Member

    hello,
    When I try to go in webmail roundcubeI have this error : Connection to IMAP server failed.
    Could you help me to resolve this problem.

    log/roundube :
    [20-Jul-2018 19:02:48 +0000]: <nctfmbod> IMAP Error: Login failed for [email protected] from xxx.xxx.69.$

    [/code]


    Thank you.
     
    Last edited: Jul 20, 2018
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    which operating system? check which imap server is defined in your roundcube config, if at all - do you use domain part as imap-sever... so many possibilites.
    can you connect to the imap server manually / using email client / cli ?
    have you changed something in regard of encryption? did you update any packages recently which may have changed your trusted certs?
    has your certificate gone invalid maybe?

    you can add
    Code:
    $config['debug_level'] = 4;
    $config['imap_debug'] = true;
    
    to your roundcube config.inc.php
    and

    Code:
    mail_debug = yes
    
    
    to your dovecot.conf and check your mail.log after a new attempt to login.
     
  3. Oitsuki

    Oitsuki Member

    I just make an update php7.2.8. I had 7.0
    I am on debian 9


    tail -f mail.log
    Code:
    Jul 20 20:46:02 ns304xxx dovecot: pop3-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert
    Jul 20 20:46:02 ns304xxx dovecot: master: Error: service(pop3-login): command startup failed, throttling for 60 secs
    Jul 20 20:46:02 ns304xxx postfix/smtpd[8338]: warning: hostname edc8.areovrt.de does not resolve to address 181.214.206.148: Name or service not known
    Jul 20 20:46:02 ns304xxx postfix/smtpd[8338]: connect from unknown[181.214.206.148]
    Jul 20 20:46:05 ns304xxx postfix/smtpd[8342]: disconnect from unknown[181.214.206.189] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 20:46:06 ns304xxx postfix/smtpd[8338]: disconnect from unknown[181.214.206.148] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 20:46:09 ns304xxx postfix/submission/smtpd[9946]: warning: cannot get RSA private key from file "/etc/postfix/smtpd.key": disabling TLS support
    Jul 20 20:46:09 ns304xxx postfix/submission/smtpd[9946]: warning: TLS library problem: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:../crypto/x509/x509_cmp.c:295:
    Jul 20 20:46:09 ns304xxx postfix/submission/smtpd[9946]: connect from unknown[93.174.93.166]
    Jul 20 20:46:09 ns304xxx postfix/submission/smtpd[9946]: disconnect from unknown[93.174.93.166] ehlo=1 auth=0/1 rset=0/1 quit=1 commands=2/4
    Jul 20 20:46:29 ns304xxx postfix/smtpd[8342]: warning: hostname edc49.areovrt.de does not resolve to address 181.214.206.189: Name or service not known
    Jul 20 20:46:29 ns304xxx postfix/smtpd[8342]: connect from unknown[181.214.206.189]
    Jul 20 20:46:30 ns304xxx postfix/smtpd[8338]: warning: hostname edc8.areovrt.de does not resolve to address 181.214.206.148: Name or service not known
    Jul 20 20:46:30 ns304xxx postfix/smtpd[8338]: connect from unknown[181.214.206.148]
    Jul 20 20:46:34 ns304xxx postfix/smtpd[8338]: disconnect from unknown[181.214.206.148] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 20:46:35 ns304xxx postfix/smtpd[8342]: disconnect from unknown[181.214.206.189] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 20:46:57 ns304xxx postfix/smtpd[8338]: warning: hostname edc49.areovrt.de does not resolve to address 181.214.206.189: Name or service not known
    Jul 20 20:46:57 ns304xxx postfix/smtpd[8338]: connect from unknown[181.214.206.189]
    Jul 20 20:46:59 ns304xxx postfix/smtpd[8342]: warning: hostname edc8.areovrt.de does not resolve to address 181.214.206.148: Name or service not known
    Jul 20 20:46:59 ns304xxx postfix/smtpd[8342]: connect from unknown[181.214.206.148]
    Jul 20 20:47:02 ns304xxx dovecot: imap-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert
    Jul 20 20:47:02 ns304xxx dovecot: master: Error: service(imap-login): command startup failed, throttling for 60 secs
    Jul 20 20:47:02 ns304xxx postfix/smtpd[8338]: disconnect from unknown[181.214.206.189] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 20:47:02 ns304xxx postfix/smtpd[8342]: disconnect from unknown[181.214.206.148] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    
    
    var/log/roundube/errors
    Code:
    [20-Jul-2018 20:29:23 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.69.237. Empty startup greeting (localhost:143) in /us$
    [20-Jul-2018 20:30:23 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.69.237. Empty startup greeting (localhost:143) i$
    [20-Jul-2018 20:31:23 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected]ov-concept.com from 104.158.69.237. Empty startup greeting (localhost:143) i$
    [20-Jul-2018 20:34:12 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.69.237. Empty startup greeting (localhost:143) i$
    [20-Jul-2018 20:35:30 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.69.237. Empty startup greeting (localhost:143) i$
    [20-Jul-2018 20:47:02 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.70.201. Empty startup greeting (localhost:143) in$
    
    
    
    [20-Jul-2018 20:29:23 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.69.237. Empty startup greeting (localhost:143) in /us$
    [/code]
     
  4. Oitsuki

    Oitsuki Member

    my roundcubeconfig

    Code:
    $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;
    
    // SMTP username (if required) if you use %u as the username Roundcube
    // will use the current username for login
    $config['smtp_user'] = '';
    
    // SMTP password (if required) if you use %p as the password Roundcube
    // will use the current user's password for login
    $config['smtp_pass'] = '';
    
    // provide an URL where a user can get support for this Roundcube installation
    // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
    $config['support_url'] = '';
    
    // Name your service. This is displayed on the login screen and in the window title
    $config['product_name'] = 'Roundcube Webmail';
    
    // this key is used to encrypt the users imap password which is stored
    // in the session record (and the client cookie if remember password is enabled).
    // please provide a string of exactly 24 chars.
    // YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
    $config['des_key'] = '';
    
    // List of active plugins (in plugins/ directory)
    // Debian: install roundcube-plugins first to have any
    $config['plugins'] = array(
    );
    // provide an URL where a user can get support for this Roundcube installation
    // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
    $config['support_url'] = '';
    
    // Name your service. This is displayed on the login screen and in the window title
    $config['product_name'] = 'Roundcube Webmail';
    
     
    Last edited: Jul 21, 2018
  5. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    Code:
    dovecot: pop3-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert
    postfix/submission/smtpd[9946]: warning: cannot get RSA private key from file "/etc/postfix/smtpd.key": disabling TLS support
    postfix/submission/smtpd[9946]: warning: TLS library problem: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:../crypto/x509/x509_cmp.c:295:
    
    there we go, there is an issue with your ssl certificate, did you install letsencrypt? is it older than 3 months? missed new symlinks?

    Btw. depending on your roundcube version, try also php 7.1 since I think there's an issue with 7.2


    edit: please remove (and now change) the des-key out of your posted config!
     
  6. Oitsuki

    Oitsuki Member

    I make a big mistake
    now I have
    CONFIGURATION ERROR
    config.inc.php was not found.
    Please read the INSTALL instructions!
    :mad:
    I don't remember where this file ? Could you tell me ? and what I must insert inside for debain 9 apache 2 ?
     
  7. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    well what did you do then?
    did you disable mod_php? did you change the apache mpm?
    how do you call your webmail?

    The configuration is in /etc/roundcube
    and probably not readable by your current php processes.

    what is
    Code:
    ls -Alah /etc/apache2/conf-enabled
    ls -Alah /etc/apache2/modules-enabled
    
    showing?
     
  8. Oitsuki

    Oitsuki Member

    well what did you do then? That's remember I have a file in etc/rouncube/ .....php* I remove because I think it's wrong manipulation of me. Maybe it's my error !
    did you disable mod_php? did you change the apache mpm?no
    how do you call your webmail? http....../webmail
    The configuration is in /etc/roundcube ==> I create a file called config.inc.php with the config above but I don't now the right of this file and the good chown

    Code:
    ls -Alah /etc/apache2/conf-enabled
    total 12K
    drwxr-xr-x 2 root root 4,0K juil. 19 20:50 .
    drwxr-xr-x 8 root root 4,0K juil. 19 20:48 ..
    lrwxrwxrwx 1 root root   34 juil. 19 20:48 apache2-doc.conf -> ../conf-available/apache2-doc.conf
    lrwxrwxrwx 1 root root   30 juil. 19 20:48 charset.conf -> ../conf-available/charset.conf
    lrwxrwxrwx 1 root root   30 juil. 19 20:48 httpoxy.conf -> ../conf-available/httpoxy.conf
    lrwxrwxrwx 1 root root   44 juil. 19 20:48 localized-error-pages.conf -> ../conf-available/localized-error-pages.conf
    lrwxrwxrwx 1 root root   30 juil. 19 20:50 mailman.conf -> ../conf-available/mailman.conf
    lrwxrwxrwx 1 root root   46 juil. 19 20:48 other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf
    lrwxrwxrwx 1 root root   33 juil. 19 20:48 phpmyadmin.conf -> ../conf-available/phpmyadmin.conf
    -rw-r--r-- 1 root root 1,3K juil. 19 20:50 roundcube.conf
    lrwxrwxrwx 1 root root   31 juil. 19 20:48 security.conf -> ../conf-available/security.conf
    lrwxrwxrwx 1 root root   36 juil. 19 20:48 serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf
    
    ls -Alah /etc/apache2/modules-enabled ==> nothing no files
     
    [code]
     
  9. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    ah my error, it should be
    Code:
    ls -Alah /etc/apache2/mods-enabled
    but nevermind...
    try
    Code:
    chgrp www-data /etc/roundcube/config.inc.php
    chmod 640 /etc/roundcube/config.inc.php
    
     
  10. Oitsuki

    Oitsuki Member

    I found in /var/lib/roundcube/config my config.inc.php else I don't know why it create this error because in /etc/roundcube/apache.conf i have this
    Code:
    <Directory /var/lib/roundcube/config>
            Options -FollowSymLinks
            AllowOverride None
    </Directory>
    
     
  11. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    The config in /var/lib/roundcube/config is usually just a symlink to /etc/roundcube/config

    this only defines the access level for a visitor.

    For php to find the config there need to be open_basedir set and proper file access permission, doesn't matter what's inside your apache for that folder :)
     
  12. Oitsuki

    Oitsuki Member

    Code:
    /etc/roundcube/
    -rw-r--r--  1 root root      1240 avril 20 23:51 apache.conf
    -rw-r--r--  1 root www-data  1519 juil. 20 21:45 config.inc.php
    -rw-r-----  1 root www-data   529 juil. 19 20:49 debian-db.php
    -rw-r--r--  1 root root       373 avril 20 23:51 debian-db-roundcube.php
    -rw-r--r--  1 root root     51999 avril 20 23:51 defaults.inc.php
    -rw-r--r--  1 root root      1940 avril 20 23:51 htaccess
    -rw-r--r--  1 root root       491 avril 20 23:51 lighttpd.conf
    -rw-r--r--  1 root root      2815 nov.  27  2016 mimetypes.php
    drwxr-xr-x 16 root root      4096 juil. 19 20:49 plugins
    [code]
    
    same thing restart postfix, apache also.
    have an idea for that ? open_basedir
     
  13. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    hmm very strange... well I don't know what you did - your roundcube config looks changed, usually it is a symlink but yours is not.
    Anything you changed in there?

    since you're on debian 9
    Do you need mod_php? is this a live system? Why not boosting your performance by some dirty mods?
    https://www.howtoforge.com/community/threads/debian-9-php-5-6-7-2-with-sury-and-isp.79528/
    and
    https://www.howtoforge.com/communit...be-enigma-munin-phpmyadmin-aliases-fix.77489/

    should get you going in a snap, except for mailman, but I guess you can figure how this works with the mods after you enabled phpmyadmin ect.
     
  14. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    the alias with a seperate subdomain is optional, in theory it should work with
    Code:
    a2disconf php-7.2-fpm
    a2disconf php7.0-fpm
    a2enconf php7.1-fpm
    
    since that replaces the mod_php behaviour, just with increased performance
     
  15. Oitsuki

    Oitsuki Member

    What I must have inside /etc/roundcube/config.inc.php, not sur the config above is correct, I also change the right in 640 . Now I have :
    Code:
    -rw-r--r--  1 root root      1240 avril 20 23:51 apache.conf
    -rw-r-----  1 root www-data  1519 juil. 20 21:45 config.inc.php
    -rw-r-----  1 root www-data   529 juil. 19 20:49 debian-db.php
    -rw-r--r--  1 root root       373 avril 20 23:51 debian-db-roundcube.php
    -rw-r--r--  1 root root     51999 avril 20 23:51 defaults.inc.php
    -rw-r--r--  1 root root      1940 avril 20 23:51 htaccess
    -rw-r--r--  1 root root       491 avril 20 23:51 lighttpd.conf
    -rw-r--r--  1 root root      2815 nov.  27  2016 mimetypes.php
    drwxr-xr-x 16 root root      4096 juil. 19 20:49 plugins
    
     
  16. Oitsuki

    Oitsuki Member

    I have website on php7.2 no pb. The other configuration is php7
    a2disconf php-7.2-fpm ==> ERROR: Conf php-7.2-fpm does not exist
    a2disconf php7.0-fpm ==> Conf php7.0-fpm already disabled
    a2enconf php7.1-fpm ==> ERROR: Conf php7.1-fpm does not exist! ==> don't have 7.1
     
  17. Oitsuki

    Oitsuki Member

    hmm very strange... well I don't know what you did - your roundcube config looks changed, usually it is a symlink but yours is not ==> create directly the config.inc.php maybe I must create just a link ? I don't know
     
  18. Oitsuki

    Oitsuki Member

    It's not the best solution, i will reinstall debian. it will be better to restart with a correct configuration.
    Thank you for your help and I hope all will be fine !!
     
  19. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    of course, that was meant for if you choose to follow the linked guides to a certain level => install at least one php-fpm ( seems you have php 7.0 fpm already, did you remove php 7.0? ) just mentioning, you would not neccesary need to create a virtualhost with all the aliases, just use one of the phpx.y-fpm to provide default php parsing using www-data.

    important parts of the roundcube-config, be aware you might not have all plugins configured or available.
    Code:
    $config = array();
    /* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
    include_once("/etc/roundcube/debian-db-roundcube.php");
    $config['smtp_port'] = 587;
    $config['smtp_user'] = '%u';
    $config['smtp_pass'] = '%p';
    $config['product_name'] = 'Roundcube Webmail';
    $config['des_key'] = '';
    $config['plugins'] = array(
    "help", "database_attachments",  "acl", "markasjunk2",
    "additional_message_headers", "newmail_notifier", "zipdownload",
    "jqueryui", "ispconfig3_account", "ispconfig3_autoreply", "ispconfig3_autoselect", "ispconfig3_pass", "ispconfig3_spam", "ispconfig3_fetchmail", "ispconfig3_filter", "ispconfig3_forward", "ispconfig3_wblist"
    );
    $config['skin'] = 'larry';
    $config['enable_spellcheck'] = false;
    #$config['debug_level'] = 4;
    #$config['sql_debug'] = true;
    #$config['imap_debug'] = true;
    
    However, having the wrong stuff in the file doesn't throw an error telling it couldn't find the file at all.
    I'd say your config for roundcube is borked in some way probably.
    Try reverting to defaults or follow my links and get awesome performance + working server :)
    If you use ISPConfig, don't worry, it won't damage it. I call the hacks dirty cause I think they are incomplete, but they do work and are probably better than the default config aaaaand could end a long back and forth with your issue I seem not be able to solve without investing significant amount of time asking/waiting which I don't have right now.

    Up to you, there may be some ppl out there who are better at this, I have a history of failed attempts helping ppl getting stuff to work it is supposed by ispconfig :D
     
  20. Oitsuki

    Oitsuki Member

    Thank you for your help, it's very appreciate
    I reinstalled my ovh debian 9 ispconfig 3.1.2 with just php7.
    I don't modify anything .
    We can restart correctly now !
    The problem come from the template of ovh ! No good
    Connection to IMAP server failed.
    nano mail.err
    Code:
     20 23:54:28 ns304xxx dovecot: master: Error: service(imap-login): command startup failed, throttling for 60 secs
    Jul 20 23:55:01 ns304xxx dovecot: pop3-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_$
    Jul 20 23:55:01 ns304xxxns304xxx dovecot: master: Error: service(pop3-login): command startup failed, throttling for 60 secs
    Jul 20 23:55:28 ns304xxx dovecot: imap-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_$
    Jul 20 23:55:28 ns304xxx dovecot: master: Error: service(imap-login): command startup failed, throttling for 60 secs
    
    tail -f mail.log
    Code:
    Jul 20 23:57:38 ns304xxx postfix/smtpd[1701]: warning: hostname edc8.areovrt.de does not resolve to address 181.214.206.148: Name or service not known
    Jul 20 23:57:38 ns304xxx postfix/smtpd[1701]: connect from unknown[181.214.206.148]
    Jul 20 23:57:46 ns304xxx postfix/smtpd[1701]: disconnect from unknown[181.214.206.148] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 23:57:58 ns304xxx dovecot: imap-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert
    Jul 20 23:57:58 ns304xxx dovecot: master: Error: service(imap-login): command startup failed, throttling for 60 secs
    Jul 20 23:58:00 ns304xxx postfix/smtpd[10997]: warning: hostname edc49.areovrt.de does not resolve to address 181.214.206.189: Name or service not known
    Jul 20 23:58:00 ns304xxx postfix/smtpd[10997]: connect from unknown[181.214.206.189]
    Jul 20 23:58:05 ns304xxx postfix/smtpd[11131]: warning: cannot get RSA private key from file "/etc/postfix/smtpd.key": disabling TLS support
    Jul 20 23:58:05 ns304xxx postfix/smtpd[11131]: warning: TLS library problem: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:../crypto/x509/x509_cmp.c:295:
    Jul 20 23:58:06 ns304xxx postfix/smtpd[11131]: warning: hostname edc8.areovrt.de does not resolve to address 181.214.206.148: Name or service not known
    Jul 20 23:58:06 ns304xxx postfix/smtpd[11131]: connect from unknown[181.214.206.148]
    Jul 20 23:58:07 ns304xxx postfix/smtpd[10997]: disconnect from unknown[181.214.206.189] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 23:58:09 ns304xxx postfix/smtpd[11131]: disconnect from unknown[181.214.206.148] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jul 20 23:58:16 ns304xxx dovecot: pop3-login: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert
    Jul 20 23:58:16 ns304xxx dovecot: master: Error: service(pop3-login): command startup failed, throttling for 60 secs
    
    roundcube/error
    Code:
    [20-Jul-2018 23:57:58 +0000]: <6jmr43a0> IMAP Error: Login failed for [email protected] from 104.158.70.2$
    [code]
     

Share This Page