Author Topic: Problem with default password plugin: did not change password  (Read 8136 times)

Offline femco

  • Jr. Member
  • **
  • Posts: 11
Problem with default password plugin: did not change password
« on: September 04, 2013, 08:35:19 AM »
Hi,
i have a plugin problem, i know that i should have posted this in the Third Party subforum but i do not know if the plugins uses the plugin API or not.

It is about the default password plugin. My web-server configuration is based upon postfix/courier/mysql, roundcube is installed and works perfectly.

I created the password configuration file (copied it from the config.inc.php.dist file) and did not changed anything. Is expected i do have the new password changing option in roundcube but using it results in the error: "password is not changed" (or similar, iam using the german localisation).

I think this is related to the folowing options in the config  file:
Code: [Select]
// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
$rcmail_config['password_db_dsn'] = '';
$rcmail_config['password_query'] = 'SELECT update_passwd(%c, %u)';

i let the first one empty because of there is not example how to fill it and because i interpreted the commend such that leaving it empty making password using the default roundcube settings (roundcube conects to the DB perfectly). But i think that i have to put something else in, something like:
Code: [Select]
$rcmail_config['password_db_dsn'] = 'mysql://localhost';
the second options seems reasonable to me, i mean i do not know what it does but i think it is calling the same update passwd function roundcube itself would call, right? Or do i have to change it to?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Problem with default password plugin: did not change password
« Reply #1 on: September 04, 2013, 12:52:10 PM »
The password_db_dsn is for the connection string to the database where the account passwords are stored, if its empty it tries to use the RoundCube database. Here is how to setup the string:
Code: [Select]
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql or sqlsrv
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path: 'sqlite:////full/path/to/sqlite.db?mode=0646'
$rcmail_config['password_db_dsn'] = 'mysql://roundcube:pass@localhost/roundcubemail';

The password_db_dsn is for the query the update the password, the update_passwd function isn't setup by default so you'll need to change it.

Offline femco

  • Jr. Member
  • **
  • Posts: 11
Re: Problem with default password plugin: did not change password
« Reply #2 on: September 04, 2013, 02:42:56 PM »
In my case i created a mail database (called 'maildb') before installing postfix. In it are 3 tables: aliases, domains, users
The users table keeps the user data including the password. I did not had to configure roundcube in any way to let it use these tables, it worked from the beginning.

If i understand you right, letting the password_db_dsn empty would make the password plugin use the roundcube database (called 'roundcube') not the mail database ('maildb') to use the mail database i have to set it like:
Code: [Select]
$rcmail_config['password_db_dsn'] = 'mysql://user:pass@localhost/maildb';
is this correct? Do i have to use the user:pass combination, or can i leave it empty and let the plugin use the roundcube default (for reducing redundancy)?

And how about the update_password function, how to acitivate/configure it or do i have to set the real query here?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Problem with default password plugin: did not change password
« Reply #3 on: September 04, 2013, 02:49:57 PM »
You would need to have the database username and password in the password_db_dsn in order for it to connect. I would just setup a query in password_db_dsn unless you need a more complicated configuration in which case you can setup a function: http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html