Check out the lightweight on-premises email archiving software developed by iRedMail team: Spider Email Archiver.
This is a brief introduction of the OpenLDAP server configured by iRedMail. It may help a little if you want to migrate from/to other LDAP server.
iRedMail requires 7 LDAP schema files listed below (1-5 are shipped by OpenLDAP, no. 6 is shipped by Amavisd, no. 7 is shipped by iRedMail):
If you're migrating to other LDAP server, it must include them all, otherwise you may not be able to add or update mail accounts.
OpenLDAP configured by iRedMail has hard-coded / predictable structure, and Postfix / Dovecot / iRedAPD /... are configured to query LDAP based on this structure.
dc=xx,dc=xx |- o=domains |- domainName=example.com |- ou=Aliases | firstname.lastname@example.org | ... |- ou=Groups | email@example.com | ... ... |- ou=Users |- firstname.lastname@example.org |- mail=xxx |- ...
With this predictable structure:
it's easy to narrow down the query scope, the narrower the scope is, the better performance you gain.
no need to performing a query first to get the full dn of ldap object you're going to modify.
If you don't use this structure:
you have to update Postfix/Dovecot/iRedAPD/... config files to use different query scopes and filters.
The web-based admin panel - iRedAdmin(-Pro) - heavily relies on the predictable structure, if you use different structure, you cannot manage mail accounts with iRedAdmin(-Pro).