Bug 34552 - Mail domain name not validated
Mail domain name not validated
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Mail
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-1-errata
Assigned To: Alexander Kläser
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-15 11:19 CEST by Dirk Wiesenthal
Modified: 2015-03-25 16:43 CET (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-04-15 11:19:10 CEST
Syntax of mail/domain's name property is string. So no further checks. But as the name is part of the domain's DN, certain characters are not allowed. If giving a "wrong" domain name, UDM just says:

The LDAP object could not be saved: LDAP Error Invalid DN syntax: invalid DN

This is an LDAP error not a UDM one. Not a big issue but the user sees a cryptic error message instead of an invalid "name" widget (like in users/user's username).
Comment 1 Alexander Kläser univentionstaff 2014-11-14 14:27:33 CET
The manual says:

"The name of a mail domain may only be composed of lowercase letters, the figures 0-9, full stops and hyphens."

This really should be validated. In my tests, I could create an arbitrary mail domain without any error occurring.
Comment 2 Alexander Kramer univentionstaff 2015-03-17 15:48:29 CET
r 59126

added a new syntax class to validate the mail domain name. Also adpated the de.po for the german translation

debian/changelog
univention-directory-manager-modules (10.0.29-34)
* Bug #34552: Validate the mail domain name

Successful build
Package: univention-directory-manager-modules
Version: 10.0.29-34.1298.201503171542
Branch: ucs_4.0-0
Scope: errata4.0-1

r 59127 yaml file
Comment 3 Alexander Kramer univentionstaff 2015-03-17 16:19:03 CET
If you want to restore the old behavior/syntax class you can overwrite the syntax from the cli:

ucr set directory/manager/web/modules/mail/domain/properties/name/syntax='string'

Also added this information to the yaml file:
r 59130
Comment 4 Alexander Kramer univentionstaff 2015-03-17 16:52:44 CET
As requested I changed the error messages and fixed the regex statement.

r 59134
debian/changelog
univention-directory-manager-modules (10.0.29-35) 
* Bug #34552: Adapted the regex and the messages

Successful build
Package: univention-directory-manager-modules
Version: 10.0.29-35.1299.201503171648
Branch: ucs_4.0-0
Scope: errata4.0-1
Host: dimma.knut.univention.de
Logfile Path: /var/univention/buildsystem2/logs/ucs_4.0-0-0-errata4.0-1/ucs_4.0-0-errata4.0-1.univention-directory-manager-modules.201503171648.log.bz2


r 59136
yaml file adapted the fix number
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2015-03-23 14:40:31 CET
REOPEN: code change

The reg exp within the syntax matches also to the empty string which is not desired. Besides that, there is already an existing syntax class that IMHO fits better: "DNS_Name"
Currently I cannot see any reason why this syntax class should not be reused.
Comment 6 Alexander Kläser univentionstaff 2015-03-24 17:14:13 CET
(In reply to Sönke Schwardt-Krummrich from comment #5)
> REOPEN: code change
> 
> The reg exp within the syntax matches also to the empty string which is not
> desired. Besides that, there is already an existing syntax class that IMHO
> fits better: "DNS_Name"
> Currently I cannot see any reason why this syntax class should not be reused.

Agreed. I take this bug such that it can be published tomorrow.

univention-directory-manager-modules (10.0.29-36) [r59362]:
* Bug #34552: replace mail_domain_name syntax with DNS_Name
Comment 7 Florian Best univentionstaff 2015-03-25 09:32:43 CET
OK: fix [en|ger]
OK: YAML
Comment 8 Janek Walkenhorst univentionstaff 2015-03-25 16:43:49 CET
<http://errata.univention.de/ucs/4.0/122.html>