Hello All
I have written a driver for the Roundcube password plugin that allows users to change their mailbox password on systems that store passwords in Dovecot passwd/userdb files (see "
http://wiki.dovecot.org/AuthDatabase/PasswdFile"). I wrote it for our installation and thought I would contribute it back (although it is only likely to be of interest for small Roundcube deployments).
The code is hosted here: "
http://code.google.com/p/dovecotpfd/" (tar archive here:
http://dovecotpfd.googlecode.com/files/dovecotpfd-1.0.tar.gz)
To use it, you will need to:
1). Place
dovecotpfd.php in
roundcube/plugins/password/drivers/2). Edit
roundcube/plugins/password/config.inc.php and add the following configuration directives to the bottom of the file:
// Dovecot Password File Driver options
// -----------------------------------------
// Specify the username format used in the passwd/userdb file (valid values are "%n" or "%u", corresponding to Dovecots %n and %u variables - see: http://wiki.dovecot.org/Variables)
$rcmail_config['password_dovecotpfd_format'] = "%n";
// Desired password hashing scheme (run dovecotpw -l for a list of supported schemes on your system)
$rcmail_config['password_dovecotpfd_scheme'] = "SSHA256";
3). Place
chgdovecotpw in
/usr/sbin4). Create a new linux user account:
# useradd -g nogroup -s /bin/false -d /dev/null mailpasswd
5). Place
dovecotpfd-setuid.c in
roundcube/plugins/password/drivers/, open it in your favourite text editor and change the UID definition to match the uid of the account created in step 4 above.
6). Compile
dovecotpfd-setuid.c and set the sticky bit:
# cd roundcube/plugins/password/drivers/
# gcc -o dovecotpfd-setuid dovecotpfd-setuid.c
# chown root:www-data dovecotpfd-setuid
# strip dovecotpfd-setuid
# chmod 4750 dovecotpfd-setuid
7). Make sure the mailpasswd user, created in step 4 above, has access to and write permission on the Dovecot passwd/userdb file (the location of which is set in
dovecotpfd.php). The mailpasswd user also needs to be able to execute
chgdovecotpw.
To activate the plugin, edit
roundcube/plugins/password/config.inc.php and set $rcmail_config['password_driver'] to 'dovecotpfd'