Why? qmail-LDAP is a very robust qmail+LDAP installation. It's a lot more than I needed. I just wanted to authenticate people to an already existing LDAP server. I didn't want to interact with LDAP in any other way. qmail-LDAP isn't made for that. So, I wrote this simple program that does one thing, authenticates against an LDAP server.
I put in a ton of comments so it should be clear how it works.
After downloading, untar it and put it in /var/qmail/bin.
Set its permissions to 755 (chmod 755 ldap_auth.pl).
Set ownership to root:qmail (chown root:qmail ldap_auth.pl).
Modify your /var/qmail/supervise/qmail-smtpd/run file like so:
exec /usr/local/bin/softlimit -m 16700000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb \
-c "$MAXSMTPD" -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/rblsmtpd -rsbl-xbl.spamhaus.org \
/var/qmail/bin/qmail-smtpd 2>&1
exec /usr/local/bin/softlimit -m 16700000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb \
-c "$MAXSMTPD" -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/rblsmtpd -rsbl-xbl.spamhaus.org \
/var/qmail/bin/qmail-smtpd \
/var/qmail/bin/ldap_auth.pl /bin/true 2>&1
The above is just an example. rblsmtpd is not related to this program. The relevant part is the last two lines.