From d81556979e6fb9815548f061d2d5c887cf8c94f5 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Tue, 1 Dec 2015 16:47:43 +0100 Subject: [PATCH] Using SQL query to change Roundcube passwords --- .../templates/roundcube-password-config.inc.php.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/ispmail-webmail/templates/roundcube-password-config.inc.php.j2 b/roles/ispmail-webmail/templates/roundcube-password-config.inc.php.j2 index 736ce90..e79d511 100644 --- a/roles/ispmail-webmail/templates/roundcube-password-config.inc.php.j2 +++ b/roles/ispmail-webmail/templates/roundcube-password-config.inc.php.j2 @@ -64,7 +64,7 @@ $config['password_db_dsn'] = 'mysql://mailuser:{{ispmail_mysql_mailuser_password // Escaping of macros is handled by this module. // Default: "SELECT update_passwd(%c, %u)" //$config['password_query'] = 'SELECT update_passwd(%D, %u)'; -$config['password_query'] = 'UPDATE virtual_users set password=%D where email=%u'; +$config['password_query'] = "UPDATE virtual_users SET password=CONCAT('{SHA256-CRYPT}', ENCRYPT (%p, CONCAT('$5$', SUBSTRING(SHA(RAND()), -16)))) WHERE email=%u;"; // By default the crypt() function which is used to create the '%c' // parameter uses the md5 algorithm. To use different algorithms @@ -78,13 +78,13 @@ $config['password_query'] = 'UPDATE virtual_users set password=%D where email=%u $config['password_idn_ascii'] = false; // Path for dovecotpw (if not in $PATH) -$config['password_dovecotpw'] = '/usr/sbin/dovecot pw'; +//$config['password_dovecotpw'] = '/usr/sbin/dovecot pw'; // Dovecot method (dovecotpw -s 'method') -$config['password_dovecotpw_method'] = 'SHA256-CRYPT'; +//$config['password_dovecotpw_method'] = 'SHA256-CRYPT'; // Enables use of password with crypt method prefix in %D, e.g. {MD5}$1$LUiMYWqx$fEkg/ggr/L6Mb2X7be4i1/ -$config['password_dovecotpw_with_method'] = true; +//$config['password_dovecotpw_with_method'] = true; // Using a password hash for %n and %q variables. // Determine which hashing algorithm should be used to generate