Custom ldap mail field
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=13894)
</details>
<!--IssueSummary end-->
Hello,
I open this as an issue but it can also be asked as a feature.
I have an ldap bind which gives me the email within the field `mail` as usual but in my case, we are using this field for legacy. We have now a new `MyCustomMail` field. Is it possible to use this field?
For example here is what I tried:
```
main:
label: 'MyLabel'
host: 'myhost.fqdn'
port: 636
uid: 'supannAliasLogin'
email: 'MyCustomMail'
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: 'cn=***,ou=***'
password: 'MyPassword'
active_directory: true
allow_username_or_email_login: true
block_auto_created_users: false
base: 'dc=***'
user_filter: ''
## EE only
group_base: ''
admin_group: ''
sync_ssh_keys: false
```
When using ldapsearch here is what I get:
```
$ ldapsearch -x -LL -h myhost.fqdn -D cn=***,ou=*** -b dc=*** -w MyPassword supannAliasLogin=mylogin \*
version: 1
dn: uid=***
[...]
supannAliasLogin: mylogin
[...]
mail: mymail@myhost.fqdn
[...]
MyCustomMail: mymail@mynewhost.fqdn
```
I can login with the `supannAliasLogin` but would like also to be able to login with `MyCustomMail`.
Hope this is not already referenced.
Cheers,
Fabien
issue