LDAP Mail Integration

LDAP can be used to identify mail recipients by configuring the mail transport agent (MTA) to issue queries to a suitable service. Where necessary, the following definitions need to be incorporated into the example configuration files given below:

Definition Purpose
LDAP_SERVICE_BIND_DN LDAP user identity to connect to the service
LDAP_SERVICE_PASSWORD LDAP user password for connection
LDAP_HOST The host providing the LDAP service
LDAP_PORT The port number of the LDAP service
LDAP_BASE_DN The section of the database to search

Using LDAP with Exim

Example configuration files for Exim are distributed in conf/exim/ldap:

File Purpose
010_exim4-config_ldap_people_outgoing Defines recipients and outgoing mail routing

Where local SMTP routing is being performed and the recipients are local system users, the following file is also useful:

File Purpose
020_exim4-config_ldap_people_local_system Defines routing for local recipients for delivery to local system mailboxes

These files can be incorporated into the Exim configuration. On Debian systems, they can be copied into /etc/exim4/conf.d/router.

Using LDAP with Postfix

Example configuration files for Postfix are distributed in conf/postfix/ldap:

File Purpose
main.cf.example Defines recipients and outgoing mail routing (for inclusion in main.cf)
virtual_alias_maps_people.cf Defines recipients and outgoing mail routing

The following files are common to LDAP and simple integration and are found in conf/postfix:

File Purpose
master.cf.items Mail handler definitions for the imip-agent transports
transport Transport definitions for /etc/postfix/transport
virtual Outgoing message routing for /etc/postfix/virtual

These files can be incorporated into the Postfix configuration. On Debian systems, master.cf.items can be merged into /etc/postfix/master.cf, whereas the other files can be merged into any existing files of the same names in /etc/postfix.

LDAP Representations for Mail Recipients

Relevant LDAP resources for structuring recipient information include the following:

RFC Relevance
RFC 2307 Defines the posixAccount object class
RFC 2739 Defines the calEntry object class supporting calFBURL
RFC 2798 Defines the inetOrgPerson object class
RFC 4524 Defines the mail attribute

An additional draft RFC describes the mailRecipient object class:

Resource schemas for LDAP are not effectively standardised for the purposes of this software. A useful object class, inetResource, was defined for the iPlanet Calendar Server:

Although Kolab maintains notions of resources, they are tied up with the notion of a shared folder and the kolabSharedFolder object class, although the mailRecipient object class is employed by resources in Kolab.