For example
works if the mail field is filled in the user profile in DC
dovecot-ldap.conf
hosts = dc2.domain.local:389
ldap_version = 3
auth_bind = yes
dn = domain\iredmail
dnpass = SUPADUPAPASSWORD
base = domain,DC=local
scope = subtree
deref = never
# Below two are required by command 'doveadm mailbox ...'
user_filter = (&(mail=%u)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_filter = (&(mail=%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/
sender_login_maps.cf
server_host = dc2.domain.local
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = iredmail@domain.local
bind_pw = SUPADUPAPASSWORD
search_base = DC=domain,DC=local
scope = sub
query_filter = (&(mail=%s)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
result_attribute= mail
debuglevel = 0
virtual_group_maps.cf
server_host = dc2.domain.local
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = iredmail@domain.local
bind_pw = SUPADUPAPASSWORD
search_base = DC=domain,DC=local
scope = sub
query_filter = (&(objectClass=group)(mail=%s))
special_result_attribute = member
leaf_result_attribute = mail
result_attribute= mail
debuglevel = 0
virtual_mailbox_maps.cf
server_host = dc2.domain.local
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = iredmail@domain.local
bind_pw = SUPADUPAPASSWORD
search_base = DC=domain,DC=local
scope = sub
query_filter = (&(mail=%s)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
result_attribute= mail
result_format = %d/%u/Maildir/
debuglevel = 0