Univention Bugzilla – Bug 50748
[ucs-test] Syntax emailAddressValidDomain does not check for valid domains
Last modified: 2020-03-12 15:32:37 CET
There should be a test script that checks if this bug still happens. +++ This bug was initially created as a clone of Bug #50747 +++ During a UCS training I noticed that the syntax emailAddressValidDomain which is used for mailPrimaryAddress does not check specified mail addresses against the local mail domain objects. Therefore the user/admin is able to specify arbitrary mail addresses. I noticed this broken behaviour with UCS 4.4-3 and 4.4-0. In 4.3-3 ist seems to be ok, so I suspect a regression during the 4.3→4.4 step.
UCS test "72_email_valid_domain" was added which checks if UDM rejects invalid maildomains. Solution on branch 4.4-3 with commits commit bbc8d9a44a89b3bac82139358f1397e43e57c034 Bug #50748: changelog commit bfc4a7c8116bb49f1b555233faa276b0727d2907 Bug #50748: Added ucs test module
OK: code OK: package was built as 9.0.3-151 OK: manual test OK: automatic tests by Jenkins are stable for both install_on_4.4-3 and upgrade_from_4.3-5_to_4.4-3: https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-3/job/AutotestUpgrade/lastBuild/SambaVersion=s4,Systemrolle=slave/testReport/40_mail/72_email_valid_domain/history/ https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-3/job/AutotestJoin/lastBuild/SambaVersion=s4,Systemrolle=slave/testReport/40_mail/72_email_valid_domain/history/ I made a few style fixes: * extract expected string as constant * merge multiple with-blocks into one * convert camel case variable to snake_case * convert single-character variable to >=3 characters [4.4-3 4f5c20470d] Bug #50748: style fixes Package was not rebuild (only safe style changes).
The test succeeds, if a user can be created with an invalid domain.
Corrected functionality of the test with commit commit 59412e43300c73a2ddf0b2bcd5ff207957760722 (HEAD -> 4.4-3, origin/HEAD, origin/4.4-3) Author: Toni Röhmeyer <roehmeyer@univention.de> Date: Fri Feb 21 13:37:30 2020 +0100 Bug #50748: corrected test functionality
OK: code works I simplified the test logic a bit. The utils.fail() can simply follow the udm.create_user() before the except-block, as that should never happen. A second utils.fail() exists in the except-block for the case, that the user creation failed for an unexpected reason. I added an error text that can occur, when the test is run with the OX app installed (found this by coincidence). BTW: the test can run on UCS systens without installed mail server app, so I changed the required "packages" to "univention-mail-postfix". [4.4-3 590e90c96f] Bug #50748: simplify test logic ucs-test (9.0.3-157)