I just tested my solution, it seems to work, here's how I did for those interested :
I start with a iRedadmin MySQL backend server.
First, install iRedMail with MySQL backend. When install is complete, install postfix-ldap, dovecot-ldap and ldap-utils packages.
I used this page to help me.
Configure postfix :
Create those files (touch) :
# touch /etc/postfix/ldap/ad_virtual_mailbox_maps.cf
# touch /etc/postfix/ldap/ad_virtual_group_maps.cf
# touch /etc/postfix/ldap/ad_sender_login_maps.cf
Don't disable iRedmail special settings as said in the howto.
Edit "smtpd_sasl_local_domain" and "transport_maps" like said in the howto.
Enable AD query :
Verify SMTP senders :
# postconf -e smtpd_sender_login_maps='proxy:ldap:/etc/postfix/ldap/ad_sender_login_maps.cf'
Used to verify local mail users :
# postconf -e virtual_mailbox_maps='proxy:ldap:/etc/postfix/ldap/ad_virtual_mailbox_maps.cf'
Used to verify local mail lists/groups :
# postconf -e virtual_alias_maps='proxy:ldap:/etc/postfix/ldap/ad_virtual_group_maps.cf \
proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, \
proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, \
proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, \
proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf'
As you can see, just add the LDAP entry to the existent line.
Don't create /etc/postfix/transport (still stored in MySQL database)
Edit /etc/postfix/ldap/ad_sender_login_maps.cf :
server_host = ad.example.com
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = vmail
bind_pw = password_of_vmail
search_base = cn=users,dc=example,dc=com
scope = sub
query_filter = (&(userPrincipalName=%s)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
result_attribute= userPrincipalName
debuglevel = 0
Edit /etc/postfix/ldap/ad_virtual_mailbox_maps.cf :
server_host = ad.example.com
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = vmail
bind_pw = passwd_of_vmail
search_base = cn=users,dc=example,dc=com
scope = sub
query_filter = (&(objectclass=person)(userPrincipalName=%s))
result_attribute= userPrincipalName
result_format = %d/%u/Maildir/
debuglevel = 0
/etc/postfix/ldap/ad_virtual_group_maps.cf : (but still not configured in main.cf)
server_host = ad.example.com
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = vmail
bind_pw = password_of_vmail
search_base = cn=users,dc=example,dc=com
scope = sub
query_filter = (&(objectClass=group)(mail=%s))
special_result_attribute = member
leaf_result_attribute = mail
result_attribute= userPrincipalName
debuglevel = 0
In the "query filter" and "result_attribute" for each files, I set "mail" in place of "userPrincipalName".
This allows me to only enable users who have an email adress specified in their AD profile. As a result, the default user "administrator" don't have access to the mail server, for example.
I repeat that you cannot set a "search_base" with only "dc=exemple,dc=com". I must create an OU where I store my users. it results : OU=mycompany,dc=example,dc=com".
Verify LDAP queries as mentionned in the howto. Groups you'll create in you AD database must have their "mail" field completed to make the query working.
Configure Dovecot :
Create /etc/dovecot/dovecot-ldap.conf :
hosts = ad.example.com:389
ldap_version = 3
auth_bind = yes
dn = vmail
dnpass = passwd_of_vmail
base = cn=users,dc=example,dc=com
scope = subtree
deref = never
user_filter = (&(userPrincipalName=%u)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_filter = (&(userPrincipalName=%u)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_attrs = userPassword=password
default_pass_scheme = CRYPT
user_attrs = =home=/var/vmail/vmail1/%Ld/%Ln/Maildir/,=mail=maildir:/var/vmail/vmail1/%Ld/%Ln/Maildir/
The same as above, I remplaced "userPrincipalName=%u" by "mail=%u" for the same reasons.
I'm testing if advanced features are working. In a first time, authentications are working well based on the AD database.
To be continued...