Then I slightly modified the kpasswd driver of the password plugin of roundcube (roundcube/plugins/password/drivers/) and created following driver: ajenti.php
<?php
/**
* ajenti Driver
*
* Driver that adds functionality to change the ajenti user password via
* the 'ajenti-ipc' command.
*
* For installation instructions please read the README file.
*
* @version 1.0
* @author Daniele Noviello <daniele.noviello@abstract.it>
*
* Based on kpasswd roundcubemail password driver by
* @author Peter Allgeyer <peter.allgeyer@salzburgresearch.at>
*/
class rcube_ajenti_password
{
public function save($currpass, $newpass)
{
$bin = rcmail::get_instance()->config->get('password_ajenti_cmd', 'sudo /usr/bin/ajenti-ipc vmail password');
$username = strstr($_SESSION['username'],'@', $before_needle = true);
$cmd = $bin . ' ' . $username . ' ' . $newpass;
$handle = popen($cmd, "w");
if (pclose($handle) == 0) {
return PASSWORD_SUCCESS;
}
else {
rcube::raise_error(array(
'code' => 600,
'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Password plugin: Unable to execute $cmd"
), true, false);
}
return PASSWORD_ERROR;
}
}
At least you need to enable roundcube to run the command with the right sudoers configuration, e.g.:
www-data ALL=(root) NOPASSWD: /usr/bin/ajenti-ipc
Now I'm able to change the password of an e-mail account in ajenti through the roundcube interface.
My solution was to create a change password command in the IPCHandler of the vh-mail plugin (ajenti-v-mail):
At least you need to enable roundcube to run the command with the right sudoers configuration, e.g.:
Now I'm able to change the password of an e-mail account in ajenti through the roundcube interface.Ubuntu: 14.04.5 LTS
ajenti: 1.2.23.8
ajenti-v: 0.2.57
ajenti-v-mail: 0.1.36
Roudcube: 1.2.2