I am now setting up the squirrelmail's change sql password plugin. but I stucked on the encryption type and the salt. And what's the password of user ispconfig in mysql? here below is my sql pass config, ----- $csp_dsn = 'mysql://root[email protected]/dbispconfig'; $lookup_password_query = 'SELECT count(*) FROM mail_user WHERE email = "%1" AND password = %4'; $password_update_queries = array('UPDATE mail_user SET password = %4 WHERE email = "%1"',); $password_encryption = 'MD5CRYPT'; $csp_salt_static = 'LEFT(password, 2)'; ----- I tried to use MD5 & MD5CRYPT, and salt as ' ' & 'LEFT(password, 2)' combination also not success.
The encryption is "crypt", this is the default on all Linux distributions: Code: $salt="$1$"; for ($n=0;$n<11;$n++) { $salt.=chr(mt_rand(64,126)); } $salt.="$"; $record[$key] = crypt($record[$key],$salt);
Sorry that I am not very familier with php, the sqmail's sql pass change only got choice of MYSQLPWD, MYSQLENCRYPT, PHPCRYPT, MD5CRYPT & MD5. And it will call a function with the same name. So, you mean I need to create a function call 'crypt' to let the password change? And, is "$1$" is the static salt that I can fill in the $csp_salt_static? or the code should be Code: $csp_salt_static = 'LEFT(password, 3)'; since "$1$" is from the first 3 of password? And, what's the password of user "ispconfig"? I may need to add into the sqlpass plugin config.
The md5crypt method should be fine, but it depends on if their implementation is compatioble with the crypt mechanism from linux. If their encryption is not compatible, you might have to implement the encryption as it is done in the example above. The password is different for every setup of course. You find it in the ispconfig config.inc.php file.
Is there anyone got success for the squirrelmail's change_sql_pass work with ISPConfig 3? I really had no idea how to work it out!!
Try changing PHP: $csp_salt_static = 'LEFT(password, 2)'; to PHP: $csp_salt_static='$1$'; for ($n=0;$n<11;$n++) { $csp_salt_static.=chr(mt_rand(64,126)); } $csp_salt_static.='$';
I still cannot make the sqmail change password~ the code provide by Croydon will cause the php change password show http500 error cannot display. Any one using squirrel mail and got the change password successful??