[RCU] How can i use '%d', '%u' in base_dn of roundcube ldap global address book?

Zhang Huangbin zhbmaillistonly at gmail.com
Thu Dec 18 03:50:40 CET 2008


Thomas Bruederli wrote:
> Zhang Huangbin wrote:
>   
>> Hi, all.
>>
>> I use OpenLDAP as global address book in roundcube-0.1.1, how can i use
>> '%d', '%u' like in postfix ldap lookup table? so that i can make the
>> user only search their own domain for address book. e.g.
>>
>>     'base_dn'       => "domainName=%d,o=domains,dc=iredmail,dc=org",
>>
>> I tried this syntax, but it failed.
>>     
>
> Those strings are only replaced if you have the 'user_specific' property of
> the ldap server config set to true.
>
> If user_specific is true RoundCube tries to bind to the LDAP server using
> 'bind_dn' and 'bind_pass' which will probably fail.
>
> This now changed in r2157 where the bind command isn't issued if 'bind_dn'
> is empty but 'user_specific' is set.
>
> ~Thomas
>
>   

Hi, Thomas.

Sorry for my late response.

I tried, but failed. My LDAP address book setting is:

----<----
$rcmail_config['ldap_public']["iRedMail"] = array(
    'name'          => 'Global Address Book',
    'user_specific' => true,
    'hosts'         => array("127.0.0.1"),
    'port'          => 389,
    'base_dn'       => "domainName=%d,o=domains,dc=iredmail,dc=org",
    //''bind_dn'       => "cn=vmail,dc=iredmail,dc=org",
    bind_dn'       => "mail=%u,domainName=%d,o=domains,dc=iredmail,dc=org",
    //''bind_pass'     => "8337$27038 at 824!19126&6465*4112)26568",
    'bind_pass'     => "%p",
    'ldap_version'  => "3",       // using LDAPv3
    'search_fields' => array('mail', 'cn'),  // fields to search in
    'name_field'    => 'cn',    // this field represents the contact's name
    'email_field'   => 'mail',  // this field represents the contact's 
e-mail
    'surname_field' => 'sn',    // this field represents the contact's 
last name
    'firstname_field' => 'gn',  // this field represents the contact's 
first name
    'scope'         => 'sub',   // search mode: sub|base|list
    'filter'        => 
"(&(objectClass=mailUser)(accountStatus=active)(enableMailService=yes)(enableDELIVER=yes))",
    'fuzzy_search'  => true);   // server allows wildcard search
----<----

But in OpenLDAP log, i saw the strings in ldap bind_dn were not 
replaced. It should be:

mail=www at a.cn, domainName=a.cn, o=domains, dc=iredmail, dc=org

But it was:

mail=%u, domainName=%d, o=domains,dc=iredmail,dc=org

I use RC 0.1.1-stable, How can i solve this issue?

Thanks very much. :)

-- 
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
  http://code.google.com/p/iredmail/

_______________________________________________
List info: http://lists.roundcube.net/users/



More information about the users mailing list