Issues with Change SQL Password plugin for Squirrel Mail on Centos 5.4 and ISPConfig3

Discussion in 'Installation/Configuration' started by centosarus, May 3, 2010.

  1. centosarus

    centosarus New Member

    I have this setup per this howto "The Perfect Server - CentOS 5.4 x86_64 [ISPConfig 3]":

    And I am trying to setup the Change SQL Password plugin per this howto: ,starting from the

    However after I logged in to webmail and tried to change the password using the new plugin, I get this error:
    I am assuming that the following code in the config.php of the pluging may not be correct:
    $csp_dsn = 'mysql://mail_admin:mail_admin_password@localhost/mail';
    Please help. Thanks
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

  3. centosarus

    centosarus New Member

    Thanks for the reply, Till.

    I changed the necessary in order to get the DB connection going, however a "Your old password does not match" error from the Change Password screen. I think it has to do with the password encryption used.

    Which encryption should I use? In the file:

    // password_encryption
       // What encryption method do you use to store passwords
       // in your database?  Please use one of the following,
       // exactly as you see it:
       //   NONE          Passwords are stored as plain text only
       //   MYSQLPWD      Passwords are stored using the MySQL password() function
       //   MYSQLENCRYPT  Passwords are stored using the MySQL encrypt() function
       //   PHPCRYPT      Passwords are stored using the PHP crypt() function
       //   MD5CRYPT      Passwords are stored using encrypted MD5 algorithm
       //   MD5           Passwords are stored as MD5 hash
       $password_encryption = 'MYSQLENCRYPT';
    and this is used also:

    $csp_salt_static = 'LEFT(password, 2)';
    Has anyone successfully used the Change SQL Password plugin with an ISPConfig3 and Squirrelmail setup??

  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

  5. centosarus

    centosarus New Member

    Unless I am mistaken, it appears that the salt is not static based on what I am seeing here in file /usr/local/ispconfig/interface/lib/classes/

    if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') {
                     for ($n=0;$n<8;$n++) {
                 $record[$key] = crypt($record[$key],$salt);
                 $sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
    } elseif { ........ }
    How does Squirrelmail handle login? How is the password checked? If you could point me in that direction, I'd be able to get that plugin to work. I think or hope.

  6. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

  7. centosarus

    centosarus New Member


    Thanks Till for your help. It's good now.

    Here is what I did:

    In the config.php of the plugin change_sqlpass, I set the following variables as followed:

    $csp_dsn = 'mysql://dbuser:dbuser_pass@localhost/ISPConfigDB';
    where dbuser is the user who has access to the ISPConfig database ISPConfigDB. Replace ISPConfigDB with the name of your ISPConfig database (dbispconfig by default) and dbuser_pass with the user password.

    $lookup_password_query = 'SELECT count(*) FROM mail_user WHERE email = "%1" AND password = %4';
    where mail_user is the table used by ISPConfig3 and email and password are the columns in that table.

    $password_update_queries = array('UPDATE mail_user SET password = %4 WHERE email = "%1"');
    $password_encryption = 'MYSQLENCRYPT';
    Till, I know you said to use MD5CRYPT but it did not work for me. When I used it, the password I enter on the change password form as my old password could not be matched with the one in the database.

    $csp_salt_static = 'LEFT(password, 12)';
    That worked for me.


Share This Page