= 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`:

{{{#!table
'''File''' || '''Purpose'''
==
`010_exim4-config_ldap_people_outgoing`
||<rowspan="4"> Defines recipients and outgoing mail routing
==
`020_exim4-config_ldap_people`
==
`020_exim4-config_ldap_resources`
==
`020_exim4-config_ldap_people_outgoing_recipients`
}}}

Where [[../LocalSMTP|local SMTP routing]] is being performed ''and'' the
recipients are local system users, the following file is also useful:

{{{#!table
'''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`:

{{{#!table
'''File''' || '''Purpose'''
==
`main.cf.example`
|| Defines recipients and outgoing mail routing (for inclusion in `main.cf`)
==
`virtual_alias_maps_people.cf`
||<rowspan="3"> Defines recipients and outgoing mail routing
==
`virtual_alias_maps_people_outgoing.cf`
==
`virtual_alias_maps_resources.cf`
}}}

The following files are common to LDAP and [[../Simple|simple]] integration
and are found in `conf/postfix`:

{{{#!table
'''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:

{{{#!table
'''RFC''' || '''Relevance'''
==
[[http://tools.ietf.org/html/rfc2307|RFC 2307]]
|| Defines the `posixAccount` object class
==
[[https://tools.ietf.org/html/rfc2739|RFC 2739]]
|| Defines the `calEntry` object class supporting `calFBURL`
==
[[http://tools.ietf.org/html/rfc2798|RFC 2798]]
|| Defines the `inetOrgPerson` object class
==
[[http://tools.ietf.org/html/rfc4524|RFC 4524]]
|| Defines the `mail` attribute
}}}

An additional draft RFC describes the `mailRecipient` object class:

 * https://tools.ietf.org/html/draft-lachman-ldap-mail-routing-03

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:

 * http://docs.oracle.com/cd/E19566-01/819-4437/6n6jckqrf/index.html#anocg
 * http://docs.oracle.com/cd/E19566-01/819-4437/6n6jckqr8/index.html

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.
