In roundcube/plugins/password/config.inc.php change code to this:
$rcmail_config['password_query'] = 'UPDATE mail_user SET password=%r WHERE email=%u LIMIT 1';
In roundcube/plugins/password/drivers/sql.php add a new macro (I added it after %o on line 90):
$sql = str_replace('%r', $db->quote(crypt($passwd,$_SESSION['username'])), $sql);
Worked for me, but only the crypt() function is used, so the format of the password wouldn't be "$1$lGr|wp|f$NU.MEUHPCGqBGIcDZSi321" anymore. Maybe somebody has a suggestion for the right macro ?!