LDAP is almost untested right now. Let's make a fake LDAP server. The problem is that LDAP uses ASN.1 and BER, which means we ultimately are testing a raw binary protocol with a moderately ugly encoding scheme. There is a generic BER encoding/decoding framework exported from libldap60 (ber_read/ber_write does char*-to-BerElement* and ber_scanf/ber_printf can pack/unpack BerElement*). If we use that, it of course relies on the assumption that those methods aren't buggy--but I think I can live with that. What features are needed: 1. Database read/write (when we get writable LDAP working, naturally) 2. Bind and access controls (both simple and SASL) 3. SSL/StartTLS (when we get them working for fakeserver, we should have them for ldapserver) 4. Search (obviously) 5. Possibly schemas From a test API, new ldapDaemon(ldif[, auth[, schema]]) is probably sufficient. Crazy idea: Specify an option to nsMailServer that allows servers the ability to transcode the event stream. The LDAP daemon would use that transcoder to convert the binary stream to a text-ish protocol that would allow the same handler architecture to be used for LDAP. Then this same architecture could be used to do SSL/StartTLS support, as well as potentially mail-via-proxy.
We could also use things like http://pyasn1.sourceforge.net/ and the perls equivallent.
While that seems like a nice package, I think I'd prefer to keep things in C/C++ or JS where possible...
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.