From: Martin F. Foster To: Stephan Bosch , Timo Sirainen Subject: patch: dovecot dict-ldap, provides src/lib-ldap, src/lib-dict/dict-ldap* Date: 02/12/2010 10:48:36 AM Hello Timo, Stephan, Attached are two files that provide a "dict-ldap" interface to Dovecot. The apply to 1.2.10 & Pigeonhole 0.1.15 Doco, and rpms for any RHEL5 derivative are here: https://www.netlog.net/files/dovecot-dev/ My motivation comes from about a month ago, when I had started a short discussion on the mailing list about having a mechanism for sieve scripts to read data from external sources, eg. an LDAP server. Stephan put together an "extdata" extension to do this, which pulled data from any configured dict interface. Pacnet's mailsystems store all routing information in LDAP. So to utilize the extdata plugin, I have written a dict-ldap (& dict-ldap-settings) for Dovecot. I thought I'd be sending this message a lot sooner than now, but it took me longer than I anticipated to get a feel for the Dovecot ecosystem. What I've done: placed this code in production, from RPMs built from the SRPM in the directory provided above. So far, so good. No segfaults, memory doesn't appear to be leaking, etc. 1. there's new src/lib-ldap/ code that provides synchronous functions for connecting & searching an LDAP server. This is heavily based on the src/auth/*ldap* code, but with all the auth dependencies removed. I did not touch the auth code! It still uses src/auth/*. Perhaps some day src/lib-ldap/ could provide generic synchronous & asynchronous LDAP read & write capability for dovecot. 2. src/lib-dict/dict-ldap* implements the bare minimum of the dict api required. that is, only init, deinit, & lookup. I don't think it's much more work to provide the iterator, but wanted to show you guys a copy of this code before attempting that. 3. the coding style isn't quite the same as yours, and there are things that I'm not 100% happy with. see "FIXME" comments in code. 4. resiliency isn't great. I don't free/unref every pool that is created with p_alloconly..() routines. The lib-ldap code won't try to reconnect/rebind if there's a problem with a server. At this time, the worst case is an auto-responder message doesn't get sent. Still, I need to address this. 5. the dict-ldap code isn't integrated with the module system yet. So to compile & use, it needs --with-ldap, and will link into the main dovecot executables. 6.