Author Topic: Active Directory Address Book  (Read 10835 times)

Offline CarlosinFL

  • Full Member
  • ***
  • Posts: 78
Active Directory Address Book
« on: January 24, 2010, 02:46:03 PM »
Can I point my Linux (Postfix, Dovecot, MySQL, & RoundCube) server to query address book for RoundCube v0.3.1 from Microsoft Active Directory from 2003 Server? I would assume so because A.D. is just LDAP with Kerberos but did a search on the forums and couldn't find anything. Maybe I used the wrong search criteria.

Anyone know if this is possible?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Active Directory Address Book
« Reply #1 on: January 24, 2010, 05:26:40 PM »
RoundCube does support LDAP, change $rcmail_config['address_book_type'] in /config/main.inc.php to LDAP. Setup the informaion in the $rcmail_config['ldap_public'] = array();
Here is the notes from the main.inc.php about how to configuration it:
Quote
// If you are going to use LDAP for individual address books, you will need to
// set 'user_specific' to true and use the variables to generate the appropriate DNs to access it.
//
// The recommended directory structure for LDAP is to store all the address book entries
// under the users main entry, e.g.:
//
//  o=root
//   ou=people
//    uid=user@domain
//  mail=contact@contactdomain
//
// So the base_dn would be uid=%fu,ou=people,o=root
// The bind_dn would be the same as based_dn or some super user login.
/*
 * example config for Verisign directory
 *
$rcmail_config['ldap_public']['Verisign'] = array(
  'name'          => 'Verisign.com',
  'hosts'         => array('directory.verisign.com'),
  'port'          => 389,
  'use_tls'       => false,
  'user_specific' => false,   // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
  // %fu - The full username provided, assumes the username is an email
  //       address, uses the username_domain value if not an email address.
  // %u  - The username prior to the '@'.
  // %d  - The domain name after the '@'.
  'base_dn'       => '',
  'bind_dn'       => '',
  'bind_pass'     => '',
  'writable'      => false,   // Indicates if we can write to the LDAP directory or not.
  // If writable is true then these fields need to be populated:
  // LDAP_Object_Classes, required_fields, LDAP_rdn
  'LDAP_Object_Classes' => array("top", "inetOrgPerson"), // To create a new contact these are the object classes to specify (or any other classes you wish to use).
  'required_fields'     => array("cn", "sn", "mail"),     // The required fields needed to build a new contact as required by the object classes (can include additional fields not required by the object classes).
  'LDAP_rdn'      => 'mail', // The RDN field that is used for new entries, this field needs to be one of the search_fields, the base of base_dn is appended to the RDN to insert into the LDAP directory.
  '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
  'sort'          => 'cn',    // The field to sort the listing by.
  'scope'         => 'sub',   // search mode: sub|base|list
  'filter'        => '',      // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
  'fuzzy_search'  => true);   // server allows wildcard search

Offline AndyFromAus

  • Newbie
  • *
  • Posts: 2
Active Directory Address Book
« Reply #2 on: March 23, 2010, 01:18:41 AM »
This is how I configured my Active Directory LDAP.
I use a different AD domain to my external domain.
The mail server I am using is hMail with AD authentication.
This example sends the users external login name as an internal login name and password,
ie: user@sample.com, becames user@sample.net.au
 
MyLDAPService = The name for your LDAP connection
MyServer = the IP address or server name for LDAP connection
internal domain name = sample.net.au
 
$rcmail_config['ldap_public']['MyLDAPService'] = array(
'name' => 'MyLDAPService',
'hosts' => array('MyServer'),
'port' => 389, // LDAP Port
'use_tls'=> false,
'user_specific' => true,
'base_dn'=> 'DC=sample,DC=net, DC=au',
'bind_dn' => '%u@sample.net.au',
'writable'=> false, // Indicates if we can write to the LDAP directory or not.
'search_fields' => array('mail', 'cn'),
'name_field' => 'cn', // this field represents the contact's name
'firstname_field' => 'givenName', // this field represents the contact's first name
'surname_field' => 'sn', // this field represents the contact's last name
'email_field' => 'mail', // this field represents the contact's e-mail
'scope' => 'sub', // search mode: sub|base|list
'filter' => '(&(mail=*)(!(msExchHideFromAddressLists=TRUE)))', // all mail, except the exchange hidden
'sort' => 'cn', // The field to sort the listing by.
'fuzzy_search' => TRUE); // server allows wildcard search