qmail-ldapam
From qmail-ldap to s/qmail+qmail-ldapam
Some years after D. J. Bernstein raised qmail, André Oppermann extended its user and configuration management interface together with significant perfomance improvements known as qmail-ldap.
While s/qmail includes those performance enhancements since some years, the question of user management by means of OpenLDAP (or other LDAP-compatible sources like Microsoft's AD) was only partially solved by means of an attached ldapam PERL module.
The basic idea behind the qmail-ldapam was to provide a checkpassword API compatible PAM, which can be called and customized for some relevant use cases though without the full-loaded solution, André Oppermann's approach delivers.
Features of qmail-ldapam
The qmail-ldapam provides a full user integraton for the following cases:
- Ingress email validation of existing mailboxes for qmail-smtpd given the RECIPIENTS extension.
- Outgress user authorization for email submission together with qmail-smtpd based on the SMTPAUTH interface.
- User verification for mailbox access either for POP3 qmail-popup or IMAP4 services given by bincimap-up.
The last case is entirely valid for stock vanilla qmail, while the other ones are encompassed by s/qmail, or some of the qmail patches provided by me.
Futher, the qmail-ldapam understands LDAP's UserPrincipalName UPN which can be used in an environment of virtual users, typically provided by VPopMail or the VMailMgr.
Unlike Andrè Oppermann's solution, the qmail-ldapam is TLS enabled, thus supporting simple bind, StartTLS enabled bind, and strong bind. Multitenancy - thus a domain-based LDAP server lookup without the requirement of referrals - is also possible.
In order to support such a behavior, qmail-ldapam reads a configuration file available at QMAILHOME/control/ldapbind. This may be matter of change.
Requirements for the qmail-ldapam
Though developed for s/qmail, the qmail-ldapam is not restricted to it. However, the following requirements need to be met:
- The fehQlibs needs to be installed.
- The OpenLDAP (at least version 2.4) library is present together with its header files.
- A LDAP server (like slapd) is setup, accessible, and users are populated.
In order to be used for SMTP email validation and/or SMTP user authorization, an existing qmail system needs to be enhanced by:
- The RECIPIENTS extension available from the Qmail support site (download: recipients-0702.tgz).
- The SMTPAUTH extension (download: qmail-authentication-083.tgz).
The SMTPAUTH extension is available in several other qmail derivatives as well, such this would work out-of-the-box.
Sources
| Version & Download | Description | fehQlibs version | Verification |
|---|---|---|---|
| qmail-ldapam-0.1 | The first release of qmail-ldapam developed for s/qmail 4.4 (still beta, LICENSE file added) | fehQlibs-31 | MD5: 137279e21211f2c001917f5ca7e42061 Build: 20261005183629 |
The qmail-ldapam's source files are documented in doxygen.
Documentation
The included documentation for the qmail-ldapam is still brief:
- README
- INSTALL
- CHANGELOG
- Man-page qmail-ldapam
How to install the qmail-ldapam
In order to get a working version of qmail-ldapam, you need to install the fitting fehQlibs in the first place. Please follow instructions here. OpenLDAP is assumed to be installed. Further, the DIT should be populated with the user DNs and is accessible.
- The qmail-ldapam is based on D. J. Bernstein's /package conventions for installation.
- Typically, un-tar the archive under /package, change to mail/ldapam-<version> and call package/install.
- However, a legacy installation, ie. at /usr/local/src is possible without restrictions.
Interaction of qmail-ldapam with the LDAP server
qmail-ldapam works Schema-free. Thus, apart from the standard POSIX schema, no particular other is required, but rather the LDAP lookup can be customized to the given DAP settings.
Typically, the following use cases may be encountered:
- Email address validation: Here, you need to setup a technical LDAP user permitted to evaluate in the DIT the 'mail' attribute in the given scope.
- User authentication: Here it is assumed, that the email user or mailbox owner has a correspoding DN with propper attributes, in particular 'mail' and/or 'home directory'.
- UserPrincipalName: Here a trustee of a user is acting als proxy user having access to the UPN and the corresponding 'password' attribute.
In case simple bind is used against a remote LDAP server, the communication can be encrypted by means of StartTLS. This is important, because the passwords are exchanged in plaintext and only protected in the backend DIT.
Strong bind is supported, but requires a X.509 client certificate for qmail-ldapam signed by the same CA as the LDAP server's cert.
Tickets, Change Requests, communication
An Ezmlmx mailing list keeps you updated with current developments, bug fixes, and features discussed. This list also can be used to file
- Defects (bug reports) and
- Change Requests (enhancements).
To inscribe use the: sqmail mailing list
As usual, I can't guarantee a certain response level; but reasonable issues will be answered.
