Author Topic: Could not connect to localhost:143: Permission denied  (Read 9733 times)

Offline MarkEHansen

  • Jr. Member
  • **
  • Posts: 10
Could not connect to localhost:143: Permission denied
« on: September 19, 2015, 07:46:32 PM »
I've installed Roundcube Webmail 1.1.2 (complete version) on a CentOS 7.0 Linux machine.

When I browse to the application (http://localhost/webmail), I get the login page. I provide my credentials and get the following error on the page:

Connection to storage server failed.

I looked in the errors file in the logs directory and found the following entry:

Code: [Select]
[19-Sep-2015 15:09:45 +0000]: <ill0okmq> IMAP Error: Login failed for meh from 10.1.1.70. Could not connect to localhost:143: Permission denied in /var/www/html/roundcube/program/lib/Roundcube/rcube_imap.php on line 198 (POST /webmail/?_task=login?_task=login&_action=login)
On the local host, I have an IMAP server running (and in use by the various e-mail clients, both local and remote). I'm guessing there some additional configuration which must be done. I looked in the config.inc.php file in the config directory, but don't see where I need to place my IMAP configuration information. Can someone please tell me where I need to place my configuration? Here are the settings I normally use to configure my other e-mail clients:

Code: [Select]
Server Type: IMAP
Server Name: {my server host name}
Port: 993
User Name: {my user name} (I assume this will come from the login page somehow)
Security Settings:
  Connection Security: SSL/TLS
  Authentication Method: Normal Password

Thanks for any help.

Offline MarkEHansen

  • Jr. Member
  • **
  • Posts: 10
Re: Could not connect to localhost:143: Permission denied
« Reply #1 on: September 19, 2015, 10:02:12 PM »
From my e-mail clients (I use Thunderbird mostly, but also have a couple Android devices with an IMAP client) - I can connect to the IMAP server from within my network using either SSL/TLS on port 993 or standard on port 143.

In looking at the HowTo_Config page, I tried the following settings, none of which work:

Code: [Select]
$config['default_host'] = 'tls://myhost:993';
$config['default_host'] = 'ssl://myhost:993';
$config['default_host'] = 'myhost:143';
$config['default_host'] = 'myhostIP:143';

In all cases, I get the following error:

Code: [Select]
[20-Sep-2015 01:56:16 +0000]: <ill0okmq> IMAP Error: Login failed for meh from 10.1.1.70. Could not connect to 10.1.1.1:143: Permission denied in /var/www/html/roundcube/program/lib/Roundcube/rcube_imap.php on line 198 (POST /webmail/?_task=login?_task=login&_action=login)

What do I need to do to get the application to be able to log into my IMAP server?

Thanks for any help.

Offline sdellenb

  • Newbie
  • *
  • Posts: 1
Re: Could not connect to localhost:143: Permission denied
« Reply #2 on: September 20, 2015, 03:16:34 AM »
By default, SELinux on CentOS is preventing the Webserver from connecting to other network services.

I found this post with a solution:
http://www.roundcubeforum.net/index.php/topic,10866.msg43084.html#msg43084

Offline MarkEHansen

  • Jr. Member
  • **
  • Posts: 10
Re: Could not connect to localhost:143: Permission denied
« Reply #3 on: September 20, 2015, 11:00:54 AM »
That was it, thanks!