Univention Bugzilla – Bug 42130
(4.1r2) Feature request: Increase handling of scheme:email options during import of user
Last modified: 2017-10-16 21:33:06 CEST
Created attachment 7923 [details] Traceback of import According to Feedback on Ticket#2016082421000167 related to the Import-Interface. Use case from the customer: Import user with an unique email. Procedure: The customer tried two different import configurations for the option scheme:email and didn't get the expected results: 1. "email": "<firstname>.<lastname>[COUNTER2]@<maildomain>" and 2. "email": "<username>@<maildomain>" The first approach doesn't fail but the String "[COUNTER2]" was added to the email address which wasn't the goal. The second approach failed with (Traceback 1 attached): ERROR user_import.create_and_modify_users:189 Entry #2: Email address '@schulen.de' has invalid format. Following configuration works: "email": "<name>@<maildomain>" Leads to lmustermann20@schulen.de I think its because the name of attribute from the the underlying ucs-school-lib UCS@school-User is "name". So, from my perspective a quick workaround would be the documentation of "email": "<name>@<maildomain>" and later on the implementation of both configuration options. 1. "email": "<firstname>.<lastname>[COUNTER2]@<maildomain>" A generic possibility to use the counters. 2. "email": "<username>@<maildomain>" Static mapping from the keywords "username" & "uid" to "email": "<name>@<maildomain>"
Created attachment 7925 [details] username = name Patch to make "username" available as formatting variable. I wouldn't like to add "uid" as an alias for username, as IMHO it is to easily confused with uidNumber.
Regarding [COUNTER] variables in other properties than username: It would be trivial to generalize ucsschool.importer.utils.username_handler.UsernameHandler to format arbitrary properties. Changes necessary: * ldap schema change: add a field for the property name * ldap queries: use property name as additional parameter * rename variables to reflect generalization ;) Please be aware, that one object per user and property is stored in cn=unique-usernames,cn=ucsschool,cn=univention,$ldap_base. So for 50,000 users with [COUNTER] variables in username and email, you'll have 100,000 ldap objects. This is not a problem as they are very small and indexed - just mentioning.
* cherry-picked commits from Bug #44993 into branch dtroeder/42130_email_counter * merged into branch 4.1r2 with commit 3247792d67ab5672810bd49bb1bf54edc763628f Unfortunately I forget to add "Bug #42130" to all commit messages. Package: ucs-school-import Version: 14.0.16-47.338.201709081035 Branch: ucs_4.1-0 Scope: ucs-school-4.1r2 Package: ucs-test-ucsschool Version: 3.0.17-65.383.201709081035 Branch: ucs_4.1-0 Scope: ucs-school-4.1r2 advisory: 12f7d8f031f402a4c229b0d96844a04788215ad4
The following tests are failing: 90_ucsschool.207_import-users_school_change.test 90_ucsschool.213_import-users_modify_with_several_groups.test 90_ucsschool.216_import-users_delete_variants.test
(In reply to Florian Best from comment #4) > The following tests are failing: > 90_ucsschool.207_import-users_school_change.test Unrelated, and was failing before. > 90_ucsschool.213_import-users_modify_with_several_groups.test Unrelated. The test seems to be mostly stable. > 90_ucsschool.216_import-users_delete_variants.test Fails because of Bug #41574. Fixed (kind of) in d4edbca4.
(In reply to Daniel Tröder from comment #5) > (In reply to Florian Best from comment #4) > > The following tests are failing: > > 90_ucsschool.207_import-users_school_change.test > Unrelated, and was failing before. OK → Bug #44310 > > 90_ucsschool.213_import-users_modify_with_several_groups.test > Unrelated. The test seems to be mostly stable. OK. > > 90_ucsschool.216_import-users_delete_variants.test > Fails because of Bug #41574. Fixed (kind of) in d4edbca4. OK, looks legit.
UCS@school 4.1 R2 v14 has been released. http://docs.software-univention.de/changelog-ucsschool-4.1R2v14-de.html If this error occurs again, please clone this bug.