Open Thatoo opened 2 weeks ago
This sounds like an enhancement request rather than a bug. :-) Seems odd to be provided with a multi-value attribute that contains different types of values.
Well, Nextcloud having a while loop on all values of an LDAP attribute would be an enhancement request but Nextcloud not checking if the given value by LDAP has or hasn't the shape of an email is a bug so I hesitate between both.
I don't mind you change it to enhancement but I think it needs some care and working on both the enhancement and the bug at the same time won't take much more work than just the bug part (checking value has the shape of email).
I've made a PR to solve this issue and enhance nextcloud : https://github.com/nextcloud/server/pull/49316
⚠️ This issue respects the following points: ⚠️
Bug description
In LDAP Advance > Special attributes > email field we enter "maildrop" a multi-value LDAP attribute. In our system (yunohost), the first value of this multi-value LDAP attribute is (it's mandatory) the username (the linux local username) and then in second value comes the transfert email adresses. Nextcloud takes the first value without testing if this value has the shape of an email address so in nextcloud users have their username in their email field instead of their eamil address.
Steps to reproduce
Expected behavior
Nextcloud should check if the first value of the multi-values LDAP attribute in LDAP Advance > Special attributes > email field has the shape of an email address. If yes, it takes it, if no, it checks the second value, if the second value has the shape of an email address it takes it, if not, the third and so on and if none of the value have the shape of an email address, it either fill the field with :
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.3
Web server
Nginx
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response