If your user email is : test@example.com
his uid is : testuser
And your ldap domain is : dc=example,dc=com
the LDAP authentication strips the domain from the email, rendering your user unable to authenticate with the email.
Solution :
You should not overwrite the username provided rather than add another username case in the case that the user should be able to authenticate with its email handle.
This option should be selectable.