-1

Just now installed whm/cpanel, created some accounts, created mail account in one of them and entered squirrelmail to check the mail.

Unfortunately it gives me an error:

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

How do I fix it? I don't know exactly, but I read some sites and maybe the problem in dns? I changed ns1.com to ns1.myhost.com in a Basic cPanel & WHM Setup

P.S. Im sure that it server configuration problem, not squirrelmail, other mail clients are not working too..

Pleerock
  • 107
  • 3

2 Answers2

3

unable to connect to localhost:143

The above message means that SquirrelMail expects an IMAP server to listen on localhost (127.0.0.1 or ::1) and port 143. Do you have an IMAP sever runnning? If so does it listen on port 143? If yes it may be the case that you have to make the imap server listen on 127.0.0.1 (localhost) too.

Otherwise check whether your imap server listens on port 993 (secure IMAP) and configure accordingly. I configure SqurrelMail by hand by executing perl conf.pl at the config directory.

adamo
  • 6,867
  • 3
  • 29
  • 58
  • I checked via `telnet open localhost 143` and it returned `OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN]` status. So it means that imap is here and on 143 port. But why does squrrelMail cannot connect to localhost:143? – Pleerock Jun 11 '12 at 11:23
  • That is because it seems that you've declared `localhost:143` as the _name_ of the host where in fact the name should have been plain `localhost`. The configuration file for SquirrelMail keeps the hostname and the port in two separate variables. – adamo Jun 11 '12 at 18:19
  • Configuration is default, after installing WHM. Not just SquirrelMail isn't working. Horde and RoundCube don't working too. Horde gives wrong username error (But username is right, I think he just handle the error as wrong username), RoundCube gives "Connection to IMAP server failed." error. Even manual connection via desktop client doesn't want to work... – Pleerock Jun 11 '12 at 18:43
  • like this problem: http://forums.cpanel.net/f43/connection-imap-server-failed-96021.html . IMAP is turned on.. – Pleerock Jun 11 '12 at 19:00
  • If the configuration is the default, _please_ try to change it, even if this means retyping the same stuff. Assuming that the defaults are correct is sometimes the real problem. Other than that I cannot help you since I am not using CPanel. – adamo Jun 11 '12 at 19:09
  • This is configuration of SquirrelMail: `4. IMAP Server : localhost 5. IMAP Port : 143` . So all is right and it seems that it cpanel's problem. Thank you for your help – Pleerock Jun 11 '12 at 19:27
-1

unable to connect to localhost:143

Check your DNS settings and make sure you have set up your IPs. I think problem is somewhere in your DNS server.

Magellan
  • 4,431
  • 3
  • 29
  • 53
Usman
  • 7
  • 2