VirtualMailManager/domain.py
changeset 704 ad15e89a93ec
parent 703 58815c004a61
child 711 2a75058fc064
--- a/VirtualMailManager/domain.py	Mon Jan 27 22:06:13 2014 +0000
+++ b/VirtualMailManager/domain.py	Wed Jan 29 20:25:09 2014 +0000
@@ -25,7 +25,9 @@
 
 
 MAILDIR_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz'
-RE_DOMAIN = re.compile(r"^(?:[a-z0-9-]{1,63}\.){1,}[a-z0-9-]{2,}$")
+RE_DOMAIN = re.compile(r"""^(?:[a-z0-9-]{1,63}\.){1,}  # one or more labels
+                            (?:[a-z]{2,}               # a ASCII TLD
+                            |xn--[a-z0-9]{4,})$        # or a ACE TLD""", re.X)
 _ = lambda msg: msg
 cfg_dget = lambda option: None