Zimbra (OSE) supports autoprovisioning, but this feature only takes care of user accounts creation. Several other scripts can be found, but none of them implemented what I needed, so I wrote this one.
* Do not only provision accounts, but update them if needed (eg : name changed)
* Support AD, OpenLDAP, or any custom LDAP schema
* Synchronize LDAP groups into distribution lists in Zimbra, preserving memberships
* Lock Zimbra accounts when the corresponding LDAP accounts are removed (or not matching the filter anymore)
* Handle email alias defined in LDAP, and translate them into aliases in Zimbra
* Allow objects (aliase, distribution list) to be created directly in Zimbra. Objects coming from LDAP are synchronized, including alias previously defined in LDAP which aren't anymore are removed from Zimbra. But aliases defined directly in Zimbra won't be touched. Same is true for distribution lists. So you can mix LDAP defined and Zimbra defined configuration
The configuration is stored in a single file in YAML format. The script will look for a config at /opt/zimbra/conf/zmldapsync.yml or the one specified in the --config argument.
* groups : defines how to search for groups in external LDAP, and which attributes will be mapped to which ones in Zimbra
* zimbra : defines some settings about how the script should behave for this domain (eg, should it create the domain if missing, should it autoconfigure external authentication etc.)
In most case, the configuration can be minimal, as defaults values are provided. You just have to set the LDAP server, bind DN and password (if applicable), and the schema. The schema can be ad, rfc2307 or rfc2307bis. If one of these schema is specified, adapted defaults values will be used