Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd May 2010, 17:49
centosarus centosarus is offline
Member
 
Join Date: Apr 2009
Posts: 46
Thanks: 9
Thanked 4 Times in 3 Posts
Default Issues with Change SQL Password plugin for Squirrel Mail on Centos 5.4 and ISPConfig3

I have this setup per this howto "The Perfect Server - CentOS 5.4 x86_64 [ISPConfig 3]":
http://www.howtoforge.com/perfect-se...64-ispconfig-3

And I am trying to setup the Change SQL Password plugin per this howto: http://www.howtoforge.com/virtual-us...-5.3-x86_64-p5 ,starting from the
Quote:
SquirrelMail comes with some pre-installed plugins, unfortunately none of them is capable of letting us change our email password in our MySQL database. But there's the Change SQL Password plugin which we can install manually:
section.

However after I logged in to webmail and tried to change the password using the new plugin, I get this error:
Quote:
Could not make database connection
I am assuming that the following code in the config.php of the pluging may not be correct:
Code:
$csp_dsn = 'mysql://mail_admin:mail_admin_password@localhost/mail';
Please help. Thanks
Reply With Quote
Sponsored Links
  #2  
Old 3rd May 2010, 18:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,951
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

This tutorial http://www.howtoforge.com/virtual-us...-5.3-x86_64-p5 is not compatible with ispconfig, ispconfig uses a different mail user table layout.

If you want to use a similar setup with ispconfig, you will have to change the settings in the config.php file to match the table and column names used for ispconfig email users.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 3rd May 2010, 22:12
centosarus centosarus is offline
Member
 
Join Date: Apr 2009
Posts: 46
Thanks: 9
Thanked 4 Times in 3 Posts
Default

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 config.ph file:

Code:
// 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:

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

Thanks
Reply With Quote
  #4  
Old 3rd May 2010, 22:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,951
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

I guess the correct function will be "MD5CRYPT".

Here is a short explanation on how the salt is composed for md5crypt:

http://www.howtoforge.com/forums/sho...4&postcount=12
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 3rd May 2010, 23:24
centosarus centosarus is offline
Member
 
Join Date: Apr 2009
Posts: 46
Thanks: 9
Thanked 4 Times in 3 Posts
Default

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/tform.inc.php:

Code:
if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') {
                 $salt="$1$";
                 $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

                 for ($n=0;$n<8;$n++) {

                  //$salt.=chr(mt_rand(64,126));

                 $salt.=$base64_alphabet[mt_rand(0,63)];

                 }
          $salt.="$";

             $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.

Thanks
Reply With Quote
  #6  
Old 3rd May 2010, 23:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,951
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

Please see here:

http://www.howtoforge.com/forums/sho...d.php?p=226924

Post #14 and #16
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 4th May 2010, 15:59
centosarus centosarus is offline
Member
 
Join Date: Apr 2009
Posts: 46
Thanks: 9
Thanked 4 Times in 3 Posts
 
Default Wonderful!!!

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:

Code:
$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.

Code:
$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.

Code:
$password_update_queries = array('UPDATE mail_user SET password = %4 WHERE email = "%1"');
Code:
$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.

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

Thanks.
Reply With Quote
The Following 2 Users Say Thank You to centosarus For This Useful Post:
falko (4th May 2010), till (5th May 2010)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setup the plugin change password of Roundcube with ISPConfig3 voltron81 Installation/Configuration 10 1st March 2011 20:54
ISPConfig3 Centos 5.4 i386 - Can not send mail in Squirrel minhphuoc275 Installation/Configuration 4 8th April 2010 12:10
amavis rejects all inbound emails aclhkaclhk Installation/Configuration 5 28th February 2010 04:24
IspConfig3 Centos 5.4 Ip Change Dizfunkshunal Installation/Configuration 2 8th February 2010 15:39
CentOS 5.4 with ISPConfig3 beezer1424 Installation/Configuration 1 29th October 2009 08:45


All times are GMT +2. The time now is 06:23.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.