Sunday, September 9, 2007

Squirrelmail with OpenLDAP Addressbook

How Squirrelmail access LDAP server addressbook? In this case you have OpenLDAP server but not an Active Directory !

  • First you must have OpenLDAP service installed on your Linux Box. You can get it free from http://www.openldap.org/software/download/
  • Your PHP must be compiled include LDAP component. You just add --with-ldap when compiling PHP from source.
  • Configure it and specify the OU schema and Addressbook schema in LDIF format.

Please find the steps below:


[/etc/openldap/slapd.conf]
#### SECURITY SETTING ###
disallow bind_anon

#######################################################################
# BDB database definitions
#######################################################################

database bdb
suffix "dc=mycompany,dc=com"
rootdn "dc=mycompany,dc=com"
rootpw {SSHA}UWPj+&**%$^*(7987897*&%*^&*^
directory /var/openldap-data
index objectClass eq


[Addressbook OU]
dn: ou=addressbook,dc=mycompany,dc=com
objectClass: top
objectClass: organizationalUnit
ou: addressbook
userPassword: {SHA}7lUIYUIYKJHKYIYtTkXU=



[Addressbook LDIF]
dn: cn=My Name (myname@mycompany.com),ou=addressbook,dc=mycompany,dc=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: My Name (myname@mycompany.com)
givenName: My Name
sn: My Name
mail: myname@mycompany.com
physicalDeliveryOfficeName: G.Kwarnas
postalAddress: G.Kwarnas
o: mycompany
l: -
ou: addressbook
st: -
postalCode: 10110
telephoneNumber: 1696
facsimileTelephoneNumber: +62-21
pager: +62-21
mobile: +62-21
homePhone: +62-21


How to load LDIF data into OpenLDAP server?
From the Linux shell please type the following command (example the file is "addressbook-2.ldif.txt") :

shell# ldapadd -x -v -c -D "dc=mycompany,dc=com" -W < addressbook-2.ldif.txt

Now is the time to configure Squirrelmail config file. Please add the following script to link your webmail with OpenLDAP server:

[Squirrelmail config.php]
$ldap_server[0] = array(
'host' => '10.80.123.203',
'base' => 'ou=addressbook,dc=mycompany,dc=com',
'name' => 'LDAP: Addressbook Global',
'binddn' => 'ou=addressbook,dc=mycompany,dc=com',
'bindpw' => 'mycompany',
'filter' => '(objectclass=*)',
'protocol' => 3,
'limit_scope' => false,
'listing' => true,
'search_tree' => true,
'starttls' => false
);


Yes! Now your webmail connected with OpenLDAP addressbook.

2 comments:

Anonymous said...

Can anyone recommend the well-priced Managed Service system for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central security management
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

top [url=http://www.001casino.com/]free casino bonus[/url] hinder the latest [url=http://www.casinolasvegass.com/]free casino[/url] manumitted no deposit reward at the chief [url=http://www.baywatchcasino.com/]www.baywatchcasino.com
[/url].

Search Linux Resources