Author Topic: Change password plugin  (Read 4231 times)

Offline skumar

  • Newbie
  • *
  • Posts: 1
Change password plugin
« on: June 06, 2013, 10:37:11 AM »
Hi,
I am using postfix-mysql on centos6.2 with dovecot  sasl login.Also for webuser I am able to login on roundcube and all working perfectly fine.Also placed config.inc.php.dist under plugin/password and enabled password change option via main.inc.php in roundcube .I got stuck with configuration of password change as can't make out what has to be paasword_db_DSN and password query.Does DB needs to be db of roundcube or it has to be my main db?Also what should be my password_query should look like?


My config looks like this for postfix DB.
Created a database for postfix with username postfix and password admin.There is table mailbox as well for mailbox logins.
 which looks like below.
CREATE TABLE `mailbox` (
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 NOT NULL,
  `maildir` varchar(255) NOT NULL,
  `quota` bigint(20) NOT NULL DEFAULT '0',
  `local_part` varchar(255) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`username`),
  KEY `domain` (`domain`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Mailboxes';

Dovecot is something like this

auth_mechanisms = plain login
passdb {
driver =sql
args = /etc/dovecot/dovecot-sql.conf
}
userdb {
driver = prefetch
}
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf
}
Dovecot-sql.conf is as below
driver = mysql
connect = host=/var/lib/mysql/mysql.sock dbname=postfix user=postfix password=admin
# Alternatively you can connect to localhost as well:
default_pass_scheme = CRYPT
password_query = SELECT password,username as user FROM mailbox WHERE username = '%u' AND active = '1'
user_query = SELECT maildir, 10000 AS uid, 10000 AS gid FROM mailbox WHERE username = '%u' AND active = '1'

All is working fine for me except password change.
Need expert opinion on this.

Regards,
Sushil

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Change password plugin
« Reply #1 on: June 07, 2013, 05:51:16 PM »
$rcmail_config['password_db_dsn'] should be the database connection string:
Code: [Select]
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'