Home > helpdesk > Fixing the “Unable to get webmail password” problem in Atmail

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.

Tags: ,
  1. May 5th, 2011 at 04:22 | #1

    Nice one! just what I needed. Thanks

  2. October 31st, 2011 at 15:50 | #2

    I recieve this bug :

    Database Connection Error
    DB Error: connect failed

    Verify the SQL database is running
    Check the SQL server is listening to the specified socket, IP address
    Check the global configuration file (/var/www/atmail/libs/Atmail/Config.php) for the correct database details
    Verify the database server is running correctly
    Verify the MySQL /etc/my.cnf file has the correct settings for the number of database connections

  3. October 31st, 2011 at 19:39 | #3

    is your database up and running?

  1. No trackbacks yet.

 
Performance Optimization WordPress Plugins by W3 EDGE