Author Topic: [Solved] password plugin + courier-imap: which driver ?  (Read 11517 times)

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
[Solved] password plugin + courier-imap: which driver ?
« on: May 23, 2012, 03:02:39 PM »
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
« Last Edit: May 28, 2012, 08:56:08 AM by Clèm »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: password plugin + courier-imap: which driver ?
« Reply #1 on: May 24, 2012, 04:12:55 AM »
Well how are you storing the user accounts?

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
Re: password plugin + courier-imap: which driver ?
« Reply #2 on: May 24, 2012, 06:26:36 AM »
The users are linux accounts.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: password plugin + courier-imap: which driver ?
« Reply #3 on: May 24, 2012, 07:14:26 AM »
Then I think you'd want to use the pam driver.

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
Re: password plugin + courier-imap: which driver ?
« Reply #4 on: May 24, 2012, 08:11:34 AM »
I modified the file /etc/roundcube/plugins/password/config.inc.php :
Code: [Select]
$rcmail_config['password_driver'] = 'pam';According to http://trac.roundcube.net/browser/github/plugins/password/README I installed php5-auth-pam:
Code: [Select]
sudo apt-get install php5-auth-pamAnd add the configuration file:
Code: [Select]
sudo cp /usr/share/doc/php5-auth-pam/examples/php /etc/pam.d/phpI added the following lines to the file:
Code: [Select]
auth sufficient /lib/security/pam_pwdb.so shadow nodelay
account sufficient /lib/security/pam_pwdb.so
Next:
Code: [Select]
sudo usermod -G shadow www-dataFinally, I restarted apache:
Code: [Select]
sudo service apache2 restart
But it's still not working:
Code: [Select]
[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=)
« Last Edit: May 24, 2012, 10:47:08 AM by Clèm »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: password plugin + courier-imap: which driver ?
« Reply #5 on: May 24, 2012, 09:31:04 AM »
Did you restart Apache?

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
Re: password plugin + courier-imap: which driver ?
« Reply #6 on: May 24, 2012, 09:38:26 AM »
Yes, I did.

Edit: The phpinfo page : http://www.forumanalogue.fr/phpinfo.php
« Last Edit: May 24, 2012, 09:41:49 AM by Clèm »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: password plugin + courier-imap: which driver ?
« Reply #7 on: May 24, 2012, 10:00:15 AM »
Hint: pam != pam_auth.

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
Re: password plugin + courier-imap: which driver ?
« Reply #8 on: May 24, 2012, 10:36:05 AM »
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:
Code: [Select]
[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=)
« Last Edit: May 24, 2012, 11:26:52 AM by Clèm »

Offline Clèm

  • Jr. Member
  • **
  • Posts: 11
    • Ubuntu-Lyon
Re: password plugin + courier-imap: which driver ?
« Reply #9 on: May 28, 2012, 08:55:36 AM »
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
Code: [Select]
sudo EDITOR=vim visudo(You can choose an other editor, like nano)
Code: [Select]
www-data ALL=NOPASSWD: /usr/sbin/chpasswdBe extremely careful ! Even is there is a check before applying the changes, it can break your system !