Fixing the “Unable to get webmail password” problem in Atmail
Plesk ships Atmail, but the default installation has a minor problem: when you open your webmail site, all you get is a message box saying “Unable to get webmail password!”. This is not caused by the user, who might have entered wrong credentials (in fact, he hasn’t even seen the webmail page yet, let alone entered his password). It’s caused by Atmail being unable to connect to its MySQL database.
The origin of this problem is in /var/www/atmail/libs/Atmail/Config.php, line 4:
fopen("/etc/psa-webmail/atmail/.atmail.shadow")
For some reason, the fopen() call fails, but there are several ways of fixing this. The easiest is to get the database password from .atmail.shadow and hard-code it in Config.php.
Disclaimer: don’t do this if you don’t know exactly what you are doing, why you are doing it and which possible consequences might result.
Now, change your /var/www/atmail/libs/Atmail/Config.php like this:
//if (!($fd = fopen("/etc/psa-webmail/atmail/.atmail.shadow", "r"))) { // echo "<script>alert('Unable to get webmail password!')</script>"; // exit(); //} //fscanf($fd, "%s", $buff); //fclose($fd); $buff = 'MySQL_password';
Note that you changed an Atmail application file, and it is very likely to be reverted by the next Plesk/Atmail update. This patch will be very helpful in that situation.