Author Topic: Connection to IMAP server failed.  (Read 23078 times)

Offline ZombieCraft

  • Newbie
  • *
  • Posts: 3
Connection to IMAP server failed.
« on: December 26, 2011, 04:06:06 PM »
I tried to set up round cube on my server. Other web clients work, such as atmail. Also, outlook also works. The problem is that RC is not connecting. I contacted my Host provider and they game me the following information:

E-mail Address/Username: youraccounthere@franklinl.com
Incoming mail server (IMAP): mail.franklinl.com
Outgoing mail server (SMTP): mail.franklinl.com
E-mail Address/Username: franko@franklinl.com
Password: whatever your password is
Incoming server (IMAP) port: 143
Outgoing server (SMTP) port: 25 or 587
SSL: No
My Server Requires Authentication: Yes This should be set to : plain or password

In the installer SMTP worked but IMAP does not.

Is it my config/RC
or is it just my host?

Happy Holidays!

Zombiecraft



Here is what I got for my config

// ----------------------------------
// 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 - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %d = domain.tld
$rcmail_config['default_host'] = 'mail.franklinl.com';

// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['imap_auth_type'] = 'plain'
// If you know your imap's folder delimiter, you can specify it here.
// Otherwise it will be determined automatically
$rcmail_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
$rcmail_config['imap_ns_personal'] = NULL;
$rcmail_config['imap_ns_other'] = NULL;
$rcmail_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.
$rcmail_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.
$rcmail_config['imap_force_lsub'] = false;

// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['imap_timeout'] = 0;

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

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

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

// Enables messages cache. Only 'db' cache is supported.
$rcmail_config['messages_cache'] = false;


// ----------------------------------
// SMTP
// ----------------------------------

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %d = domain.tld
$rcmail_config['smtp_server'] = 'mail.franklinl.com';

// SMTP port (default is 25; 465 for SSL)
$rcmail_config['smtp_port'] = 25;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$rcmail_config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['smtp_auth_type'] = 'plain';

// Optional SMTP authentication identifier to be used as authorization proxy
$rcmail_config['smtp_auth_cid'] = NULL;

// Optional SMTP authentication password to be used for smtp_auth_cid
$rcmail_config['smtp_auth_pw'] = NULL;

// SMTP HELO host 
// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages 
// Leave this blank and you will get the server variable 'server_name' or 
// localhost if that isn't defined. 
$rcmail_config['smtp_helo_host'] = '';

// SMTP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['smtp_timeout'] = 0;

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,376
    • http://SKaero.com/
Connection to IMAP server failed.
« Reply #1 on: December 26, 2011, 05:15:28 PM »
The only problem I see is:
Code: [Select]
$rcmail_config['imap_auth_type'] = 'plain'
it should be:
Code: [Select]
$rcmail_config['imap_auth_type'] = 'PLAIN';
or:
Code: [Select]
$rcmail_config['imap_auth_type'] = 'LOGIN';

Offline ZombieCraft

  • Newbie
  • *
  • Posts: 3
I changed the config
« Reply #2 on: December 26, 2011, 06:12:06 PM »
I have changed the variable in main.inc.php on line 150 and line 79to
Code: [Select]
$rcmail_config['imap_auth_type'] = 'LOGIN';
Code: [Select]
$rcmail_config['smtp_auth_type'] = 'LOGIN';I also tried using 'PLAIN' instead of 'LOGIN'
but it still won't work. The error log show
Code: [Select]
[26-Dec-2011 23:02:53 +0000]: IMAP Error: Login failed for no-reply@franklinl.com from my.ip.adress.is.here. Could not connect to mail.franklinl.com:143: Connection refused in /srv/disk1/Hostingaccountname/www/webmail.zombiecraft.org/program/include/rcube_imap.php on line 205 (POST /?_task=login&_action=login)
The server works, I tried it using my phone and outlook. I just don't get why it isn't working...

I am not very good with mail servers but what is the difference between 'PLAIN' and 'LOGIN'?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,376
    • http://SKaero.com/
Connection to IMAP server failed.
« Reply #3 on: December 26, 2011, 06:34:19 PM »
Try changing $rcmail_config['default_host'] & $rcmail_config['smtp_server'] to "localhost". PLAIN and LOGIN are different ways of sending the password to login to the IMAP server but the error shows that its failing before that point.

Offline ZombieCraft

  • Newbie
  • *
  • Posts: 3
Connection to IMAP server failed.
« Reply #4 on: December 26, 2011, 07:17:25 PM »
I have chnaged the default server from mail.franklinl.com to localhost. Then I tried using PLAIN and LOGIN.

It still doesn't work. I tried to connect using IlohaMail, and it works so I think it is not my host's problem. I prefer roundcube because it has more features, that is why I am still trying to get it to works.

Code: [Select]
[27-Dec-2011 00:04:47 +0000]: IMAP Error: Login failed for myemail@franklinl.com from my.ip.adress.here. Could not connect to localhost:143: Connection refused in /srv/disk1/MyHostingProvider/www/webmail.zombiecraft.org/program/include/rcube_imap.php on line 205 (POST /?_task=login&_action=login)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,376
    • http://SKaero.com/
Connection to IMAP server failed.
« Reply #5 on: December 27, 2011, 12:26:38 AM »
Its not a auth problem because RoundCube can't even connect to the mail server which would usually meen a firewall problem but it odd that other systems on the same server can connect to it.

Offline LAMurakami

  • Newbie
  • *
  • Posts: 2
Re: Connection to IMAP server failed.
« Reply #6 on: August 09, 2018, 07:14:02 PM »
In my case this error was fixed by modifying the /etc/hosts to replace the localhost line with a line that has FullyQualifiedDomainName short-name localhost and deleting a second line that had the short-name.  I know this is an old post but I have not seen this answer elsewhere.