roundcube/roundcubemail — pull request #227 by lopezio (2014-10-04 12:55:36+00:00)
Title: Adds support for both dovecot CRAM-MD5 authentication and ldap binding, ...

Hi guys there.

I have the issue that I have to support both CRAM-MD5 (method known to dovecot and postfix), and LDAP binding but still do not want to store plain passwords in the database. The only solution to this, as I found out so far, is to store two userPassword values in LDAP. One as {CRAM-MD5} stored like dovecot does it, and any one other supported by LDAP bind. I wrote this patch, and hope that you can pull it upstream after reviewing. Would be great. Please apoligize if I made any form errors here, it's my first pull request ;)

Lorenzo

implemented by:

- enabling multiple ldap userPasswords (ldap does not support CRAM-MD5 bind, so it needs more than one). Backward-compatible: just add encodings in password_ldap_encodage separating with a plus (+).
- adding a helper by Hajo Noerenberg (dovecot) to generate the dovecot hmac md5 (see helpers/dovecot_hmacmd5.php)
- updated config documentation
Also corrects the handling of ssha passwords: if sha1 function is present, it will be preferred (as it outputs the correct password for ldap, whereas hash seems not).