SymptomsNote: The article applies only to Debian OS-es.
There are more than 600 domains on the server. When I try to log in to Horde, it says that the password is incorrect, even though I am entering the correct credentials.
The Horde test page (http://webmail.domain.com/imp/test.php) reports an error when trying to authenticate:
Unable to create selectable TCP socket (3531 >= 1024)
Also, an Apache restart may fail with this error in logs:
[Thu Jul 26 23:53:42 2012] [notice] caught SIGTERM, shutting down
(24)Too many open files: apache2: could not open error log file /var/www/vhosts/domain.com/statistics/logs/error_log.
Unable to open logs
CauseThe issue is caused by a bug in the uw-imap package of Debian systems:
BUG #478193: php5-imap file open error >1024
The PHP imap_open function has a check that will not allow you to create a connection if there are more than 1024 files opened by Apache.
ResolutionTo resolve it, enable piped logging for Apache, as is described in this KB article:
2066 How do I enable Piped Logs for Apache Web Server?