I am trying to install change password plugin to roundcube but it does not work. The error log show
DB Error: MDB2 Error: not found Query: _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT update_passwd(’…’, ‘…’)] [Native code: 1305] [Native message: FUNCTION abc_roundcube.update_passwd does not exist] in /home/abc/public_html/webmail/program/include/rcube_mdb2.php on line 727 (POST /webmail/?_task=settings&_action=plugin.password-save?_task=&_action=)
Thank you so much and write the step. I tried but still no lucky. It show below error on log.
PHP Error: Password plugin: Unable to execute /home/abc/public_html/webmail/plugins/password/helpers/chgvirtualminpasswd in /home/abc/public_html/webmail/plugins/password/drivers/virtualmin.php on line 73 (POST /webmail/?_task=settings&_action=plugin.password-save?_task=&_action=)
Well, I still working solution for password change and currently virtualmin installed on ubuntu 12.04 LTS version.
I tested the command “./chgvirtualminpasswd modify-user --domain $domain --user $username --pass $newpass” on console. It worked, therefore I believe that it is some problem on PHP or something wrong.
Just found that I used username@domain for format but the change passward code passed wrong information to command and caused unable to change passward. I am checking the code.
I did discover one issue… while I’m not sure about the user@domain issue you saw, I did see that even when using the user.domain format, it could still run into issues where Virtualmin was getting confused, thinking it’s being called from a web browser.
But it’s technically not, it’s command line API is being called.
You may need to set (or rather, unset) an environment variable where RoundCube is calling out to the Virtualmin command line program.
Eric,
Thanks again. I found the problem that when the command exec("$curdir/chgvirtualminpasswd modify-user --domain $domain --user $username --pass $newpass", $output, $returnvalue); triggered. It is incorrect information passed to value.
For example :
The virtualmin email format is user@domain
If the email address is “keith@abc.com”, the result of value is
$domain = abc.com (correct)
$username = keith-abc.com (incorrect), problem is here. It should be “keith”, therefore it caused error here.
$newpass = 12345 (correct)
Okay, if you jump to line 51 of “roundcube/plugins/password/drivers/virtualmin.php”, you’ll see this case statement:
case 8: // domain taken from alias, username left as it was
$email = $rcmail->user->data['alias'];
$domain = substr(strrchr($email, "@"), 1);
break;
Try adding in the following $username line, so that it looks like this:
case 8: // domain taken from alias, username left as it was
$email = $rcmail->user->data['alias'];
$domain = substr(strrchr($email, "@"), 1);
$username = str_replace("-$domain", "", $username);
break;
When using the user@domain format, that should correct it so that it passes in a username that Virtualmin understands.
But I am still getting new password could not be saved:
[01-Apr-2013 18:21:08 +0100]: PHP Error: Password plugin: Unable to execute /home/conjurenet/domains/webmailapp.domain.com/public_html/plugins/password/helpers/chgvirtualminpasswd in /home/mycompany/domains/webmailapp.domain.com/public_html/plugins/password/drivers/virtualmin.php on line 75 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)
chown root.mydomain.com plugins/password/helpers/chgvirtualminpasswd.c (note the .c above - since there is no chgvirtualminpasswd file)
Yeah, that’s the problem there
If you don’t have the file “chgvirtualminpasswd”, that’ll cause the error you’re seeing.
That suggests you may have missed a step in the documentation you linked to
I’d suggest going over those steps again, and making sure they’re all complete. Pay particular attention to the step where you compile the program by running ‘gcc’.
the .c file was downloaded when installing the plugin. There was no file “chgvirtualminpasswd” included in the download. Can I just rename the chgvirtualminpasswd.c into chgvirtualminpasswd? (maybe a stupid question as I am not familiar with running gcc)