Fixing Roundcube Password Plugin

In this guide we are looking at fixing the problem with Roundcube 1.6+ when changing the Password in Webmail itself. On VDN Networks we use Roundcube to serve Webmail so does a lot of hosting companies.

From Roundcube 1.6+ there are a lot of changes with its way it’s writes the changes to backend Databases. When changing a Users Password you will see a red box on the bottom right saying Password Could Not be Saved. (When updating Roundcube it doesn’t update it’s config files so if you have been updating from old versions of Roundcube it will not update the Password Configuration files).

Looking into the logs under /var/log/mail.log you will see this.

roundcube: <1hqk058k> DB Error: [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%D,passwordlastchange=NOW() WHERE username='user@domain.co.uk'' at line 1 (SQL Query: UPDATE mailbox SET password=%D,passwordlastchange=NOW() WHERE username='user@domain.co.uk') in /opt/www/roundcubemail/program/lib/Roundcube/rcube_db.php on line 577 (POST /mail/?_task=settings&_action=plugin.password-save)

When the Roundcube Password Plugin writes to the databases with the wrong SQL Parameters you will get these errors. To Fix this we need to update the Password Plugin Config Files, under /opt/www/roundcubemail/plugins

We need to change the following,

$config['password_algorithm'] = 'clear';

to 

$config['password_algorithm'] = "ssha512";

$config['password_algorithm_prefix'] = '';

to

$config['password_algorithm_prefix'] = "{SSHA512}"; 
$config['password_query'] = "UPDATE mailbox SET password=%D,passwordlastchange=NOW()  WHERE username=%u";

to

$config['password_query'] = "UPDATE mailbox SET password=%P,passwordlastchange=NOW()  WHERE username=%u"; 

After doing the above fixes, Test the Password Plugin.

Enjoy VDN IT Team.

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *