LDAP name collision - can't use "mail" as ldap.usernameField

When trying to configure Openfire against LDAP for user information and authentication, there appears to be an issue. Perhaps it is user error, but I’m not sure how to get around it.

I have an LDAP server with various companies in different OUs:

ou=companyA,dc=domain,dc=com

ou=companyB,dc=domain,dc=com

If “uid” is simply used as the ldap.usernameField, the possibility of a name collision exists. For instance, if there is a uid=erik in both companies, Openfire cannot tell the difference. Effectively, you have a name collision.

Unfortunately, you cannot use “mail” as the ldap.usernameField. When trying to use this field during set-up, you cannot complete the “Administrator Account” section.

– Trying to add a user by email results in an “Illegal JID” error: http://pastie.org/2580421

– Trying to add a user by uid doesn’t work: “No username was provided or the specified username was not found.”

Does anyone have a solution or suggestion?