Postfix Openldap integration

From Zarafa wiki

Jump to: navigation, search

This article describes how you can integrate a Postfix MTA with an OpenLDAP servers.


Contents

LDAP schemas and attributes

When using OpenLDAP the default email addresses are stored in the attribute mail. In this setup we use the attribute zarafaAliases from the Zarafa schema to store the email aliases.

Configure OpenLDAP for email aliases

  • Copy the Zarafa schema from /usr/share/doc/zarafa/zarafa.schema to the /etc/openldap/schema directory.
  • Reload the OpenLDAP server


Configure Postfix with LDAP support

The Postfix package in most Linux distributions has LDAP support by default. In the following steps we will explain how to configure Postfix with a LDAP backend.

Main.cf

Add the following lines to the end of the /etc/postfix/main.cf

zarafa_destination_recipient_limit = 1
virtual_transport = lmtp:localhost:2003

# Define the domains we use the virtual transport for
virtual_mailbox_domains = example.com, domain.com
# Example configuration to find a mailbox in LDAP
virtual_mailbox_maps = ldap:ldap-users
ldap-users_server_host = localhost
ldap-users_search_base = ou=Users,dc=exanple,dc=com
ldap-users_scope = sub
ldap-users_query_filter = (mail=%s)
ldap-users_result_attribute = mail

# Optional: virtual aliases maps from LDAP
virtual_alias_maps = ldap:ldap_virtual_alias
ldap_virtual_alias_server_host = localhost
ldap_virtual_alias_search_base = ou=Users,dc=example,dc=com
ldap_virtual_alias_scope = sub
ldap_virtual_alias_query_filter = (zarafaAliases=%s)
ldap_virtual_alias_result_attribute = mail

The virtual_transport will specify the delivery method for all incoming emails if no other transport matches specified above.

Add your email domains to the option virtual_mailbox_domains.

The search base of the users and aliases need to be set to the correct search base of your LDAP server.

After you changed your configuration files reload Postfix via the init-script:

 /etc/init.d/postfix reload

Make sure the zarafa-dagent run as daemon and is started at boot time

 chkconfig zarafa-dagent on
 /etc/init.d/zarafa-dagent start


Zarafa LDAP configuration

This article does not cover the LDAP configuration in Zarafa. To do that you can use the Administrator Manual.

Every incoming email is now delivered to the zarafa-dagent with the corresponding mailbox name. The zarafa-dagent delivers the email to the zarafa-server.

Personal tools