cPanel: php_network_getaddresses: getaddrinfo failed: Name or service not known

I found out this problem just after the disk replace on backup drive but have no idea why it is occurred. However, the fixes is found.

With this issue, you may find the following error,

In SquirrelMail:

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

In HordeMail:

Login failed because your username or password was entered incorrectly.

In RoundCube:

Connection to IMAP server failed.

To resolve this problem, try to check the following issue,
1. If /etc/nsswitch.conf is exists.
2. If the permission of /etc/nsswitch.conf is 644, else do,

chmod 644 /etc/nsswitch.conf

3. check if /etc/nsswitch.conf come with any content. Update your system to get the fresh content.

cPanel RoundCube: An error occurred while saving

If you are using cPanel roundcube email services and when you try to modify your signature and getting error of “An error occurred while saving” without able to allow you to save the setting. You may refer to this article.

With this case, I am using email user of [email protected], hence you may refer to the step as below to resolve the issue.

1. Log into the SSH, go to the path of /home/username/etc/ where my path will be /home/mickgenie/etc/
2. Rename or delete the file named user.rcube.db where my case will be user.rcube.db.
3. Visit your RoundCube again and the problem should be resolved.