Bug 50748 - [ucs-test] Syntax emailAddressValidDomain does not check for valid domains
[ucs-test] Syntax emailAddressValidDomain does not check for valid domains
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: UDM
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Toni Röhmeyer
Daniel Tröder
:
Depends on: 50747
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-29 11:00 CET by Sönke Schwardt-Krummrich
Modified: 2020-03-12 15:32 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 4: Will affect most installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.137
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2020-01-29 11:00:32 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.
Comment 1 Toni Röhmeyer univentionstaff 2020-02-12 15:05:57 CET
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
Comment 2 Daniel Tröder univentionstaff 2020-02-20 11:57:12 CET
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).
Comment 3 Daniel Tröder univentionstaff 2020-02-21 08:01:58 CET
The test succeeds, if a user can be created with an invalid domain.
Comment 4 Toni Röhmeyer univentionstaff 2020-02-21 13:39:31 CET
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
Comment 5 Daniel Tröder univentionstaff 2020-02-24 12:45:51 CET
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)