Roundcube password plugin for Virutalmin hosting panel is a great feature for your users, if you don’t want them to use Usermin as mail client, and be able to change their password. After long time I decided to research and solve the problem for Roundcube password plugin. At the end of the article you will find sources helped me solve this issue.
Users in virtualmin are unix users so roundcube uses a php driver for virtualmin which calls a C wrapper to run the command on the system (/usr/sbin/virtualmin modify-user). You need to modify some configuration files to enable password plugin on roundcube, change two lines (73,74) in virtualmin.php and compile the C wrapper in order to be able to run. Read below…
Steps to setup the RoundCube Password Plugin
Install RoundCube via Virtualmin Install Script (we’ll assume that it’s being installed into the sub-dir “roundcube”. The current version, as of these instructions, is 1.1.2.
Log into the server over SSH. Go into the “roundcube” directory you just installed RoundCube into. For example,
Edit config/main.inc.php, and change this line:
$rcmail_config['plugins'] = array('virtuser_file');
$rcmail_config[‘plugins’] = array( ‘password’);
Setup password plugin config file with this command (or via FTP):
cp plugins/password/config.inc.php.dist plugins/password/config.inc.php
Enable Virtualmin driver. To do that, edit “plugins/password/config.inc.php”, and change this line:
$rcmail_config['password_driver'] = 'sql';
$rcmail_config['password_driver'] = 'virtualmin';
Compile C wrapper with this command (gcc must be installed for this to work):
gcc -o plugins/password/helpers/chgvirtualminpasswd plugins/password/helpers/chgvirtualminpasswd.c
chown root.VIRTUAL_SERVER_GROUP_NAME plugins/password/helpers/chgvirtualminpasswd
chmod 4550 plugins/password/helpers/chgvirtualminpasswd
Modify virtualmin.php driver:
This is my version of virtualmin.php driver, it’s slightly different than the original. It works for roundcube v1.1.2
Lines changed: 73,74
You should now be able to log into RoundCube, go into Settings -> Password, and change your user’s password.