[CMF-checkins] SVN: CMF/branches/2.1/C - CMFDefault.utils: The email validation would reject addresses where

Jens Vagelpohl jens at dataflake.org
Fri Aug 31 13:05:54 EDT 2007


Log message for revision 79407:
  - CMFDefault.utils: The email validation would reject addresses where
    the domain part started with a single letter element.
    (http://www.zope.org/Collectors/CMF/495)
  

Changed:
  U   CMF/branches/2.1/CHANGES.txt
  U   CMF/branches/2.1/CMFDefault/tests/test_utils.py
  U   CMF/branches/2.1/CMFDefault/utils.py

-=-
Modified: CMF/branches/2.1/CHANGES.txt
===================================================================
--- CMF/branches/2.1/CHANGES.txt	2007-08-31 16:24:37 UTC (rev 79406)
+++ CMF/branches/2.1/CHANGES.txt	2007-08-31 17:05:54 UTC (rev 79407)
@@ -2,6 +2,10 @@
 
   Bug Fixes
 
+    - CMFDefault.utils: The email validation would reject addresses where
+      the domain part started with a single letter element.
+      (http://www.zope.org/Collectors/CMF/495)
+
     - Fixed a bug in the site manager creation code, which would assign the
       __parent__ pointer to the Aq-wrapper and not the actual object. Also
       prevented the getMainGlobals script to fail if not content-type header
@@ -11,6 +15,7 @@
       as StateChangeInfo passes on the new status to after-transition scripts.
       (http://www.zope.org/Collectors/CMF/490)
 
+
 CMF 2.1.0 (2007/08/08)
 
   New Features

Modified: CMF/branches/2.1/CMFDefault/tests/test_utils.py
===================================================================
--- CMF/branches/2.1/CMFDefault/tests/test_utils.py	2007-08-31 16:24:37 UTC (rev 79406)
+++ CMF/branches/2.1/CMFDefault/tests/test_utils.py	2007-08-31 17:05:54 UTC (rev 79407)
@@ -258,6 +258,8 @@
         self.assertEqual(checkEmailAddress('username_ at example.com'), None)
         # CMF Collector issue #401
         self.assertEqual(checkEmailAddress("user'site at example.com"), None)
+        # CMF Collector issue #495
+        self.assertEqual(checkEmailAddress("user at a.example.com"), None)
         self.assertRaises(EmailAddressInvalid, checkEmailAddress,
                           'this is not an e-mail address')
         self.assertRaises(EmailAddressInvalid, checkEmailAddress,

Modified: CMF/branches/2.1/CMFDefault/utils.py
===================================================================
--- CMF/branches/2.1/CMFDefault/utils.py	2007-08-31 16:24:37 UTC (rev 79406)
+++ CMF/branches/2.1/CMFDefault/utils.py	2007-08-31 17:05:54 UTC (rev 79407)
@@ -513,7 +513,7 @@
 # RFC 2821 domain: sequence of dot-separated labels
 # characters allowed in label: A-Za-z0-9-, first is a letter
 # Even though the RFC does not allow it all-numeric domains do exist
-_DOMAIN_RE = re.compile(r'[^@]{1,64}@[A-Za-z0-9][A-Za-z0-9-]+'
+_DOMAIN_RE = re.compile(r'[^@]{1,64}@[A-Za-z0-9][A-Za-z0-9-]*'
                                 r'(\.[A-Za-z0-9][A-Za-z0-9-]*)+$')
 
 security.declarePublic('checkEmailAddress')



More information about the CMF-checkins mailing list