2006-05-03myldap

myldap for dummies

If you have contact information stored in a MySQL database, myldap can most likely export it to your favourite e-mail application. The way you have them stored in the database must be told to myldap, but myldap supports quite complex schemes.

The problem

LDAP as described in RFC2251 and others, is widely used for accessing e-mail addresses of contacts. Any decent e-mail application has an interface for accessing these kind of resources. Besides e-mail addresses, LDAP can be used to retrieve other contact information as well, like postal addresses, ... Note that LDAP defines a communication, rather than the backend storage, although most LDAP servers come with their own, optimized storage solution.
MySQL on the other hand is a good database server, widely used on internet. A MySQL client can be easily written in C, C++, Java, PHP. This makes it an ideal database to easily implement different kind of contact information.
The big problem is that MySQL, as any database, requires a rather fixed table layout with columns, whereas LDAP implies a rather ad-hoc collection of items with attributes. The LDAP structures do not map easily on a database layout. Some implementations exist, but they touch the simplicity of database storage in favor of flexibility. As a result, very few people have their LDAP data stored in a database, and very few people enjoy the simplicity of a database for storing e-mail contacts.
To merge LDAP with MySQL, e-circ has created myldap. It allows to create easy database layouts, which are then published over LDAP. Because of the database storage, it does not allow different LDAP schemes. It's most important use is the retrieval of contact information by any e-mail client. Accessing the MySQL data with other MySQL clients, or with web services using PHP, makes it possible to integrate the contact information into larger server applications.
The MySQL coverage provided with openldap might satisfy the need for pure LDAP serving, but certainly does not allow for integration with other database applications. Therefore, the idea of one single place for data storage is lost.

The use

A lot of MySQL driven applications/web services exist today. Chances are real you already have some kind of contact information stored in a database. myldap can publish them over LDAP.
In case you're looking for some contact database, just proceed, myldap will be able to publish it too. You might want to examine the capabilities, but they're mostly limited to your MySQL syntax knowledge, rather than myldap's.

How it works

myldap is a program designed to run from any inetd alike server. Incoming connections to a specified port will trigger inetd to execute myldap, stdin & stdout redirected to your TCP/IP connection.
myldap uses a file holding it's configuration.

myldap in action

myldap is tested with these LDAP clients I have a screenshot here of Mozilla's address book. It shows a company "A Company", with an employee linked to it (MySQL joins), John Doe. He has a phone number within the company. If he wouldn't, the company's number would show, as does now the company's fax number.

The price

myldap runs well when properly configured. This configuration is not well documented in detail, as it requires good MySQL knowledge and basic LDAP knowledge. Therefore, myldap comes with installation support, which is not free of charge.
Designed by e-circ