Author Topic: cant get password plugin to work with roundcube  (Read 35336 times)

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
cant get password plugin to work with roundcube
« on: March 24, 2012, 05:17:44 AM »
hello all
its been the whole 5 days since i have been trying to get this thing to work .
i am on (cetos 5.7and ) running kolox 6.1.12 and set up roundcube beta 0.8 without anyproblem under a subdomain called mail.ustmb.ir .
i found out that the email address and their other related information are stored in koloxo database , under a table named : mailaccount
in mailaccount table , nname field represents email addresses and password field represents passwords .
and with these in mind i configured the config.inc.php
i configured the main.inc.php to use password plugin .
i copied the config.inc.php to the config folder of roundcube and it is as follow:
Code: [Select]
<?php

// Password Plugin options
// -----------------------
// A driver to use for password change. Default: "sql".
// See README file for list of supported driver names.
$rcmail_config['password_driver'] = 'sql';

// Determine whether current password is required to change password.
// Default: false.
$rcmail_config['password_confirm_current'] = true;

// Require the new password to be a certain length.
// set to blank to allow passwords of any length
$rcmail_config['password_minimum_length'] = 0;

// Require the new password to contain a letter and punctuation character
// Change to false to remove this check.
$rcmail_config['password_require_nonalpha'] = false;

// Enables logging of password changes into logs/password
$rcmail_config['password_log'] = false;


// SQL Driver options
// ------------------
// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
$rcmail_config['password_db_dsn'] = '';

// The SQL query used to change the password.
// The query can contain the following macros that will be expanded as follows:
//      %p is replaced with the plaintext new password
//      %c is replaced with the crypt version of the new password, MD5 if available
//         otherwise DES.
//      %D is replaced with the dovecotpw-crypted version of the new password
//      %o is replaced with the password before the change
//      %n is replaced with the hashed version of the new password
//      %q is replaced with the hashed password before the change
//      %h is replaced with the imap host (from the session info)
//      %u is replaced with the username (from the session info)
//      %l is replaced with the local part of the username
//         (in case the username is an email address)
//      %d is replaced with the domain part of the username
//         (in case the username is an email address)
// Escaping of macros is handled by this module.
// Default: "SELECT update_passwd(%c, %u)"
$rcmail_config['password_query'] = 'UPDATE mailaccount SET password=%r WHERE nname=%u LIMIT 1';

// By default domains in variables are using unicode.
// Enable this option to use punycoded names
$rcmail_config['password_idn_ascii'] = false;

// Path for dovecotpw (if not in $PATH)
// $rcmail_config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw';

// Dovecot method (dovecotpw -s 'method')
$rcmail_config['password_dovecotpw_method'] = 'CRAM-MD5';

// Enables use of password with crypt method prefix in %D, e.g. {MD5}$1$LUiMYWqx$fEkg/ggr/L6Mb2X7be4i1/
$rcmail_config['password_dovecotpw_with_method'] = false;

// Using a password hash for %n and %q variables.
// Determine which hashing algorithm should be used to generate
// the hashed new and current password for using them within the
// SQL query. Requires PHP's 'hash' extension.
$rcmail_config['password_hash_algorithm'] = 'sha1';

// You can also decide whether the hash should be provided
// as hex string or in base64 encoded format.
$rcmail_config['password_hash_base64'] = false;


// Poppassd Driver options
// -----------------------
// The host which changes the password
$rcmail_config['password_pop_host'] = 'localhost';

// TCP port used for poppassd connections
$rcmail_config['password_pop_port'] = 106;


// SASL Driver options
// -------------------
// Additional arguments for the saslpasswd2 call
$rcmail_config['password_saslpasswd_args'] = '';


// LDAP and LDAP_SIMPLE Driver options
// -----------------------------------
// LDAP server name to connect to. 
// You can provide one or several hosts in an array in which case the hosts are tried from left to right.
// Exemple: array('ldap1.exemple.com', 'ldap2.exemple.com');
// Default: 'localhost'
$rcmail_config['password_ldap_host'] = 'localhost';

// LDAP server port to connect to
// Default: '389'
$rcmail_config['password_ldap_port'] = '389';

// TLS is started after connecting
// Using TLS for password modification is recommanded.
// Default: false
$rcmail_config['password_ldap_starttls'] = false;

// LDAP version
// Default: '3'
$rcmail_config['password_ldap_version'] = '3';

// LDAP base name (root directory)
// Exemple: 'dc=exemple,dc=com'
$rcmail_config['password_ldap_basedn'] = 'dc=exemple,dc=com';

// LDAP connection method
// There is two connection method for changing a user's LDAP password.
// 'user': use user credential (recommanded, require password_confirm_current=true)
// 'admin': use admin credential (this mode require password_ldap_adminDN and password_ldap_adminPW)
// Default: 'user'
$rcmail_config['password_ldap_method'] = 'user';

// LDAP Admin DN
// Used only in admin connection mode
// Default: null
$rcmail_config['password_ldap_adminDN'] = null;

// LDAP Admin Password
// Used only in admin connection mode
// Default: null
$rcmail_config['password_ldap_adminPW'] = null;

// LDAP user DN mask
// The user's DN is mandatory and as we only have his login,
// we need to re-create his DN using a mask
// '%login' will be replaced by the current roundcube user's login
// '%name' will be replaced by the current roundcube user's name part
// '%domain' will be replaced by the current roundcube user's domain part
// '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
// Exemple: 'uid=%login,ou=people,dc=exemple,dc=com'
$rcmail_config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com';

// LDAP search DN
// The DN roundcube should bind with to find out user's DN
// based on his login. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// Use this if you cannot specify a general template for user DN with
// password_ldap_userDN_mask. You need to perform a search based on
// users login to find his DN instead. A common reason might be that
// your users are placed under different ou's like engineering or
// sales which cannot be derived from their login only.
$rcmail_config['password_ldap_searchDN'] = 'cn=roundcube,ou=services,dc=example,dc=com';

// LDAP search password
// If password_ldap_searchDN is set, the password to use for
// binding to search for user's DN. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// Warning: Be sure to set approperiate permissions on this file so this password
// is only accesible to roundcube and don't forget to restrict roundcube's access to
// your directory as much as possible using ACLs. Should this password be compromised
// you want to minimize the damage.
$rcmail_config['password_ldap_searchPW'] = 'secret';

// LDAP search base
// If password_ldap_searchDN is set, the base to search in using the filter below.
// Note that you should comment out the default password_ldap_userDN_mask setting
// for this to take effect.
$rcmail_config['password_ldap_search_base'] = 'ou=people,dc=example,dc=com';

// LDAP search filter
// If password_ldap_searchDN is set, the filter to use when
// searching for user's DN. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// '%login' will be replaced by the current roundcube user's login
// '%name' will be replaced by the current roundcube user's name part
// '%domain' will be replaced by the current roundcube user's domain part
// '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
// Example: '(uid=%login)'
// Example: '(&(objectClass=posixAccount)(uid=%login))'
$rcmail_config['password_ldap_search_filter'] = '(uid=%login)';

// LDAP password hash type
// Standard LDAP encryption type which must be one of: crypt,
// ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
// Please note that most encodage types require external libraries
// to be included in your PHP installation, see function hashPassword in drivers/ldap.php for more info.
// Default: 'crypt'
$rcmail_config['password_ldap_encodage'] = 'crypt';

// LDAP password attribute
// Name of the ldap's attribute used for storing user password
// Default: 'userPassword'
$rcmail_config['password_ldap_pwattr'] = 'userPassword';

// LDAP password force replace
// Force LDAP replace in cases where ACL allows only replace not read
// See http://pear.php.net/package/Net_LDAP2/docs/latest/Net_LDAP2/Net_LDAP2_Entry.html#methodreplace
// Default: true
$rcmail_config['password_ldap_force_replace'] = true;

// LDAP Password Last Change Date
// Some places use an attribute to store the date of the last password change
// The date is meassured in "days since epoch" (an integer value)
// Whenever the password is changed, the attribute will be updated if set (e.g. shadowLastChange)
$rcmail_config['password_ldap_lchattr'] = '';

// LDAP Samba password attribute, e.g. sambaNTPassword
// Name of the LDAP's Samba attribute used for storing user password
$rcmail_config['password_ldap_samba_pwattr'] = '';
 
// LDAP Samba Password Last Change Date attribute, e.g. sambaPwdLastSet
// Some places use an attribute to store the date of the last password change
// The date is meassured in "seconds since epoch" (an integer value)
// Whenever the password is changed, the attribute will be updated if set
$rcmail_config['password_ldap_samba_lchattr'] = '';


// DirectAdmin Driver options
// --------------------------
// The host which changes the password
// Use 'ssl://host' instead of 'tcp://host' when running DirectAdmin over SSL.
// The host can contain the following macros that will be expanded as follows:
//     %h is replaced with the imap host (from the session info)
//     %d is replaced with the domain part of the username (if the username is an email)
$rcmail_config['password_directadmin_host'] = 'tcp://localhost';

// TCP port used for DirectAdmin connections
$rcmail_config['password_directadmin_port'] = 2222;


// vpopmaild Driver options
// -----------------------
// The host which changes the password
$rcmail_config['password_vpopmaild_host'] = 'localhost';

// TCP port used for vpopmaild connections
$rcmail_config['password_vpopmaild_port'] = 89;


// cPanel Driver options
// --------------------------
// The cPanel Host name
$rcmail_config['password_cpanel_host'] = 'host.domain.com';

// The cPanel admin username
$rcmail_config['password_cpanel_username'] = 'username';

// The cPanel admin password
$rcmail_config['password_cpanel_password'] = 'password';

// The cPanel port to use
$rcmail_config['password_cpanel_port'] = 2082;

// Using ssl for cPanel connections?
$rcmail_config['password_cpanel_ssl'] = true;

// The cPanel theme in use
$rcmail_config['password_cpanel_theme'] = 'x';


// XIMSS (Communigate server) Driver options
// -----------------------------------------
// Host name of the Communigate server
$rcmail_config['password_ximss_host'] = 'mail.example.com';

// XIMSS port on Communigate server
$rcmail_config['password_ximss_port'] = 11024;


// chpasswd Driver options
// ---------------------
// Command to use
$rcmail_config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';


// XMail Driver options
// ---------------------
$rcmail_config['xmail_host'] = 'localhost';
$rcmail_config['xmail_user'] = 'YourXmailControlUser';
$rcmail_config['xmail_pass'] = 'YourXmailControlPass';
$rcmail_config['xmail_port'] = 6017;


// hMail Driver options
// -----------------------
// Remote hMailServer configuration
// true:  HMailserver is on a remote box (php.ini: com.allow_dcom = true)
// false: Hmailserver is on same box as PHP
$rcmail_config['hmailserver_remote_dcom'] = false;
// Windows credentials
$rcmail_config['hmailserver_server'] = array(
    
'Server' => 'localhost'// hostname or ip address
    
'Username' => 'administrator'// windows username
    
'Password' => 'password' // windows user password
);


// Virtualmin Driver options
// -------------------------
// Username format:
// 0: username@domain
// 1: username%domain
// 2: username.domain
// 3: domain.username
// 4: username-domain
// 5: domain-username
// 6: username_domain
// 7: domain_username
$rcmail_config['password_virtualmin_format'] = 0;
now if i try to change the password in roundcube , i get the error " Couldnt save password " , when i go to the logs , i see the error :
Code: [Select]
[24-Mar-2012 06:38:17] MDB2 Error: not found (-4): _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT update_passwd('$1$bf88gV5S$0DPI8MG8sbxzDXghbA.SM.', 'test@ustmb.ir')]
[Native code: 1305]
[Native message: FUNCTION testrd.update_passwd does not exist]

[24-Mar-2012 06:38:17 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$bf88gV5S$0DPI8MG8sbxzDXghbA.SM.', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)


and if i go to the plugins/password/drivers/sql.php
and instead of
Code: [Select]
$sql = 'SELECT update_passwd(%c, %u)';
i use:
 
Code: [Select]
$sql = 'UPDATE mailaccount SET password=%c WHERE nname=%u LIMIT 1';i get the error :
Code: [Select]
[24-Mar-2012 07:15:13] MDB2 Error: no such table (-18): _doQuery: [Error message: Could not execute statement]
[Last executed query: UPDATE mailaccount SET password='$1$8Oi8Zpnl$G77uPHGehOC78GSua4LaL1' WHERE nname='test@ustmb.ir' LIMIT 1]
[Native code: 1146]
[Native message: Table 'testrd.mailaccount' doesn't exist]

[24-Mar-2012 07:15:13 -0400]: DB Error: MDB2 Error: no such table Query: _doQuery: [Error message: Could not execute statement] [Last executed query: UPDATE mailaccount SET password='$1$8Oi8Zpnl$G77uPHGehOC78GSua4LaL1' WHERE nname='test@ustmb.ir' LIMIT 1] [Native code: 1146] [Native message: Table 'testrd.mailaccount' doesn't exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)


if i use chpasswd as the driver instead of sql in the config.inc.php , and if i let everything else as they are , i still get the error
Code: [Select]
couldnt save the password and in the log this is the error :
Code: [Select]
[24-Mar-2012 07:22:23] MDB2 Error: not found (-4): _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT update_passwd('$1$ROiZSVHI$jjm86evaEiNqqFh1FBsuJ.', 'test@ustmb.ir')]
[Native code: 1305]
[Native message: FUNCTION testrd.update_passwd does not exist]

[24-Mar-2012 07:22:23 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$ROiZSVHI$jjm86evaEiNqqFh1FBsuJ.', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)

i must mention that , there is another installation of roundcube which came with koloxo ( recides in /home/koloxo/httpd/webmail/roundcube ). and it is functional (though the version is old probably 0.6 ) .
i am really exausted of trying numerous times . i was not successful .
i would appreciate any kind of help . so please help me . ( i was desperately trying to register at this forum for 3 days ! and i got lucky to get the activation link )

Thanks in advance
 
« Last Edit: March 26, 2012, 03:43:37 PM by Coderx »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #1 on: March 24, 2012, 06:58:41 AM »
Sorry for the forum problems we were having some problems over the last couple of weeks. My guess is that your problem is that your not specifying a different database to connect to change the password. You'll need to set:
Code: [Select]
$rcmail_config['password_db_dsn']
To the database that the mail users are stored in.

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #2 on: March 24, 2012, 09:47:24 AM »
Thank you .
but it didnt help .
here is the complete set of my configs and errors :

i set it like this (because the mail accounts information is stored in this database ( the table name is mailaccount)-(and my roundcube installation database name is (testrd)) :
Code: [Select]
$rcmail_config['password_db_dsn'] = 'kloxo';but still im getting the error (while the driver is set to chpasswd ) and sql.php is intact :
Code: [Select]
[24-Mar-2012 11:59:05] MDB2 Error: not found (-4): _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT update_passwd('$1$b5FpPIZX$MlOta8DXw8DFDVXngpaQS0', 'test@ustmb.ir')]
[Native code: 1305]
[Native message: FUNCTION testrd.update_passwd does not exist]

[24-Mar-2012 11:59:05 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$b5FpPIZX$MlOta8DXw8DFDVXngpaQS0', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)

now the sql.php is changed . i replaced
Code: [Select]
$sql = 'SELECT update_passwd(%c, %u)';
with
Code: [Select]
$sql = 'UPDATE mailaccount SET password=%c WHERE nname=%u LIMIT 1';and the error is :
Code: [Select]
[24-Mar-2012 12:01:10] MDB2 Error: no such table (-18): _doQuery: [Error message: Could not execute statement]
[Last executed query: UPDATE mailaccount SET password='$1$O6c9S9mt$DT9B0Nl0bNAG84d7bUvsT/' WHERE nname='test@ustmb.ir' LIMIT 1]
[Native code: 1146]
[Native message: Table 'testrd.mailaccount' doesn't exist]

[24-Mar-2012 12:01:10 -0400]: DB Error: MDB2 Error: no such table Query: _doQuery: [Error message: Could not execute statement] [Last executed query: UPDATE mailaccount SET password='$1$O6c9S9mt$DT9B0Nl0bNAG84d7bUvsT/' WHERE nname='test@ustmb.ir' LIMIT 1] [Native code: 1146] [Native message: Table 'testrd.mailaccount' doesn't exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)

-----------------------------------
i changed the driver to sql
Code: [Select]
$rcmail_config['password_driver'] = 'sql';when the sql.php is intact i get the error :
Code: [Select]
[24-Mar-2012 12:13:07] MDB2 Error: not found (-4): _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT update_passwd('$1$ngRLPzV2$C6BuqBWT73.igs9VAR7nl1', 'test@ustmb.ir')]
[Native code: 1305]
[Native message: FUNCTION testrd.update_passwd does not exist]

[24-Mar-2012 12:13:07 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$ngRLPzV2$C6BuqBWT73.igs9VAR7nl1', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)
(by the way  when i mistakenly entered the current password as the newpassword and clicked save , a green message showed up which said successfully saved , i logged out and logged in tried to change the password to sth else , and it failed . i checked it with the following condition too and the same scenario repeats, )


when the sql.php is altered just like before i get the error :
Code: [Select]
[24-Mar-2012 12:14:36] MDB2 Error: no such table (-18): _doQuery: [Error message: Could not execute statement]
[Last executed query: UPDATE mailaccount SET password='$1$MuMnkvCz$bfmT87T83/jqxxl1zFFtn1' WHERE nname='test@ustmb.ir' LIMIT 1]
[Native code: 1146]
[Native message: Table 'testrd.mailaccount' doesn't exist]

[24-Mar-2012 12:14:36 -0400]: DB Error: MDB2 Error: no such table Query: _doQuery: [Error message: Could not execute statement] [Last executed query: UPDATE mailaccount SET password='$1$MuMnkvCz$bfmT87T83/jqxxl1zFFtn1' WHERE nname='test@ustmb.ir' LIMIT 1] [Native code: 1146] [Native message: Table 'testrd.mailaccount' doesn't exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)

what am i missing ? why is it trying to find mailaccount on testrd ? (my roundcube installation database? )
« Last Edit: March 24, 2012, 10:10:23 AM by Coderx »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #3 on: March 24, 2012, 10:30:21 AM »
Your format of the $rcmail_config['password_db_dsn'] is incorrect, it should be:
Code: [Select]
mysql://[b]DB_User[/b]:[b]DB_password[/b]@localhost/[b]Database[/b]

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #4 on: March 24, 2012, 12:07:07 PM »
still no success .
sql.php intact , i get this error :
[24-Mar-2012 14:16:23] MDB2 Error: not found (-4): _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT update_passwd('$1$BLSvkl06$Ao2yTkzBncbiL0u.OzBRw0', 'test@ustmb.ir')]
[Native code: 1305]
[Native message: FUNCTION testrd.update_passwd does not exist]

[24-Mar-2012 14:16:23 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$BLSvkl06$Ao2yTkzBncbiL0u.OzBRw0', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)





altered sql.php : i get this error:

Code: [Select]
[24-Mar-2012 14:13:42] MDB2 Error: no such table (-18): _doQuery: [Error message: Could not execute statement]
[Last executed query: UPDATE mailaccount SET password='$1$swCFKGF7$AK9asYcY8MLj0p7JuFmFL1' WHERE nname='test@ustmb.ir' LIMIT 1]
[Native code: 1146]
[Native message: Table 'testrd.mailaccount' doesn't exist]

[24-Mar-2012 14:13:42 -0400]: DB Error: MDB2 Error: no such table Query: _doQuery: [Error message: Could not execute statement] [Last executed query: UPDATE mailaccount SET password='$1$swCFKGF7$AK9asYcY8MLj0p7JuFmFL1' WHERE nname='test@ustmb.ir' LIMIT 1] [Native code: 1146] [Native message: Table 'testrd.mailaccount' doesn't exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #5 on: March 24, 2012, 11:55:55 PM »
Its obviously not picking up settings in the config.inc.php as you shouldn't need to edit the sql.php at all. Just to confirm you copied the <RC root>/plugins/password/config.inc.php.dist to <RC root>/plugins/password/config.inc.php and are making all the changes in that file, correct?

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #6 on: March 25, 2012, 04:09:25 AM »
Its obviously not picking up settings in the config.inc.php as you shouldn't need to edit the sql.php at all. Just to confirm you copied the <RC root>/plugins/password/config.inc.php.dist to <RC root>/plugins/password/config.inc.php and are making all the changes in that file, correct?
what? are you sure?  ???
cause i think i read it in a way , that i had to copy <RC root>/plugins/password/config.inc.php.dist to <RC root>/config/config.inc.php !!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #7 on: March 25, 2012, 04:37:04 AM »
Yes I'm sure thats where is should be copied, trust me I've setup the password plugin a number of times  ;)

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #8 on: March 25, 2012, 05:25:58 AM »
thank you .
i did as you instructed me .
now in password section there are 3 fields instead of the previously two fields! , tried to change the password , didnt give me any message after doing so !! logged out and tried to log in again using the new password , and it was a failure again!
looking the logs , i found this error :
Code: [Select]
[24-Mar-2012 14:16:23 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$BLSvkl06$Ao2yTkzBncbiL0u.OzBRw0', 'test@ustmb.ir')] [Native code: 1305] [Native message: FUNCTION testrd.update_passwd does not exist]  in /home/admin/Public_html/mail/program/include/rcube_mdb2.php on line 722 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)
[24-Mar-2012 14:35:00 -0400]: IMAP Error: Could not save message in INBOX.Drafts in /home/admin/Public_html/mail/program/steps/mail/sendmail.inc on line 705 (POST /?_unlock=loading1332692667051?_task=mail&_action=send)
[25-Mar-2012 07:29:20 -0400]: IMAP Error: Login failed for test@ustmb.ir from 31.57.133.43. LOGIN: Login failed. in /home/admin/Public_html/mail/program/include/rcube_imap.php on line 191 (POST /?_task=login&_action=login)

i also changed the driver to chpasswd
and after saving the new password , it prompted that "saved successfully " message .! but infact the password didnt change . here is the error for this :
Code: [Select]
[25-Mar-2012 07:37:48] PHP Warning:  popen() has been disabled for security reasons in /home/admin/Public_html/mail/plugins/password/drivers/chpasswd.php on line 22
[25-Mar-2012 07:37:48] PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/admin/Public_html/mail/plugins/password/drivers/chpasswd.php on line 23
[25-Mar-2012 07:37:48] PHP Warning:  pclose(): supplied argument is not a valid stream resource in /home/admin/Public_html/mail/plugins/password/drivers/chpasswd.php on line 25
[25-Mar-2012 07:38:14 -0400]: IMAP Error: Login failed for test@ustmb.ir from 31.57.133.43. LOGIN: Login failed. in /home/admin/Public_html/mail/program/include/rcube_imap.php on line 191 (POST /?_task=login&_action=login)
« Last Edit: March 25, 2012, 05:31:05 AM by Coderx »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #9 on: March 25, 2012, 06:22:53 AM »
Well it looks like with your current php security setup it doesn't look like it will be possible to use the chpasswd driver. As for the SQL setup you need to setup your database connection in <RC root>/plugins/password/config.inc.php make sure to set $rcmail_config['password_db_dsn'] to connect to the database where the mail users are stored and set $rcmail_config['password_query'] with the query thats needed to update the table.

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #10 on: March 25, 2012, 06:45:00 AM »
Well it looks like with your current php security setup it doesn't look like it will be possible to use the chpasswd driver. As for the SQL setup you need to setup your database connection in <RC root>/plugins/password/config.inc.php make sure to set $rcmail_config['password_db_dsn'] to connect to the database where the mail users are stored and set $rcmail_config['password_query'] with the query thats needed to update the table.
thanks
but for the sql part , as you have already pointed out , and i obeyed , all is done and configured as described .!
for example $rcmail_config['password_db_dsn'] is configured this way :
Code: [Select]
$rcmail_config['password_db_dsn'] = 'mysql://koloxousr:koloxopass@localhost/kloxo';and $rcmail_config['password_query'] is configured like this :
Code: [Select]
$rcmail_config['password_query'] = 'UPDATE mailaccount SET password=%c WHERE nname=%u LIMIT 1';knowing the fact that , email accounts created in koloxo are stored in a table called "mailaccount" in a database called koloxo .
in the mailaccount table has nname field for email addresses and password field for the respective email address password .

so i did as instructed . what is missing ?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #11 on: March 25, 2012, 07:45:07 AM »
And your still getting the error:
Quote
[24-Mar-2012 14:16:23 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$BLSvkl06$Ao2yTkzBncbiL0u.OzBRw0', 'test@ustmb.ir')]

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #12 on: March 25, 2012, 09:11:46 AM »
And your still getting the error:
Quote
[24-Mar-2012 14:16:23 -0400]: DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd('$1$BLSvkl06$Ao2yTkzBncbiL0u.OzBRw0', 'test@ustmb.ir')]
yes obviously  ??? because you said i shouldnt change anything in sql.php , and i didnt .

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: cant get password plugin to work with roundcube
« Reply #13 on: March 25, 2012, 09:30:05 AM »
Hmm, it sounds like its still not reading the config file then. You are using the original <RC root>/plugins/password/drivers/sql.php file, correct? And just out or curiosity what version of RoundCube are you using?

Offline Coderx

  • Jr. Member
  • **
  • Posts: 27
Re: cant get password plugin to work with roundcube
« Reply #14 on: March 25, 2012, 09:44:54 AM »
Hmm, it sounds like its still not reading the config file then. You are using the original <RC root>/plugins/password/drivers/sql.php file, correct? And just out or curiosity what version of RoundCube are you using?
yes
and i am installing the latest public beta ( 0.8 )
do you think i should have a clean install again ? i mean re extracting the files and then setting everything up once more again ?
-----------------
deleted the old folder , installed a new 0.8 roundcube , configured as instructed above , still not a go .
tried to change password , prompted "saved successfully" , but actually it didnt change any thing . in error log there is only :
Code: [Select]
[25-Mar-2012 12:35:21 -0400]: IMAP Error: Login failed for test@ustmb.ir from 31.57.153.203. LOGIN: Login failed. in /home/admin/Public_html/mail/program/include/rcube_imap.php on line 191 (POST /?_task=login&_action=login)-----------------
sth strange happens here .
when i go to the password section and try to change it to sth else , when i click save , to save new password , it seems to actually change the password , because when i immediately try to change the newly created password , if i enter old password ( the one i used to log-in ) as the current password it gives an error saying the current password is wrong !! ,and only when i eneter the newly created(changed) password , it grants the password change , meaning goes on well and shows me the "saved successfully " message .

but when i log out and then try to log in with the new password ! it gives me an error ,  but i can log in using the old password ! .
it seems the password is being reset to the original one on log out or sth !!!
« Last Edit: March 26, 2012, 03:46:00 PM by Coderx »