Roundcube Community Forum

 

[Solved] password plugin + courier-imap: which driver ?

Started by Clèm, May 23, 2012, 03:02:39 PM

Previous topic - Next topic

Clèm

Hello,

I activated the password plugin to allow users to change their password from roundcube. My MDA is courier-imap-ssl but I don't know which driver I should use instead of sql:
$rcmail_config['password_driver'] = 'sql';
?

Thanks

SKaero

Well how are you storing the user accounts?

Clèm


SKaero

Then I think you'd want to use the pam driver.

Clèm

#4
I modified the file /etc/roundcube/plugins/password/config.inc.php :
$rcmail_config['password_driver'] = 'pam';
According to http://trac.roundcube.net/browser/github/plugins/password/README I installed php5-auth-pam:
sudo apt-get install php5-auth-pam
And add the configuration file:
sudo cp /usr/share/doc/php5-auth-pam/examples/php /etc/pam.d/php
I added the following lines to the file:
auth sufficient /lib/security/pam_pwdb.so shadow nodelay
account sufficient /lib/security/pam_pwdb.so

Next:
sudo usermod -G shadow www-data
Finally, I restarted apache:
sudo service apache2 restart

But it's still not working:
[24-May-2012 14:04:25 +0200]: PHP Error: Password plugin: PECL-PAM module not loaded in /var/lib/roundcube/plugins/password/drivers/pam.php on line 33 (POST /roundcube/?_task=settings&_action=plugin.password-save?_task=&_action=)

SKaero


Clèm

#6
Yes, I did.

Edit: The phpinfo page : http://www.forumanalogue.fr/phpinfo.php

alec


Clèm

#8
Ok. I don't have any knowledge in this area, so I don't know what to do with his information.

Edit:

I success to enable the pam plugin. There is a bug in Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/php-auth-pam/+bug/798571/comments/2


The new logs:
[24-May-2012 17:20:13 +0200]: PHP Error: Password plugin: PAM authentication failed for user ***:  in /var/lib/roundcube/plugins/password/drivers/pam.php on line 24 (POST /roundcube/?_task=settings&_action=plugin.password-save?_task=&_action=)

Clèm

I solved my problem.

I choose the chpasswd driver. Then, I gave the right to apache to change the user password without enter the sudo password. To do that, I used the command
sudo EDITOR=vim visudo
(You can choose an other editor, like nano)
www-data ALL=NOPASSWD: /usr/sbin/chpasswd
Be extremely careful ! Even is there is a check before applying the changes, it can break your system !