View Issue Details

IDProjectCategoryView StatusLast Update
0001399SOGoWeb Mailpublic2011-10-14 20:44
Reportermra Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.8 
Target Version1.3.9Fixed in Version1.3.9 
Summary0001399: Bug andd Bugfix: Create new Mail -- Split of E-Mail-Address broken
Description

When using an email address like "Winzig, Wili <willi@example.com", the address will be spllited incorrect into two addresses "Winzig" and "Wili <willi@example.com".
(See screenshots)

This bugreport does provide a patch for fixing the issue.

TagsNo tags attached.

Relationships

has duplicate 0001436 resolvedludovic comma in name results in splitting addres 

Activities

2011-07-28 20:36

 

screenshot1.png (26,247 bytes)   
screenshot1.png (26,247 bytes)   

2011-07-28 20:36

 

screenshot2.png (31,111 bytes)   
screenshot2.png (31,111 bytes)   

2011-07-28 20:37

 

patch_SOGo_UIxMailToSelection_addressFieldChanged.diff (1,358 bytes)   
#
# old_revision [829ccf73000a2d91a5daf67741479e395011b6a8]
#
# patch "UI/WebServerResources/UIxMailToSelection.js"
#  from [2f7d2014bd7970b64db99474b30567ccebecbc3c]
#    to [01f8c5ff4a8fd72b5bbf7802c09c24912d3149ac]
#
============================================================
--- UI/WebServerResources/UIxMailToSelection.js	2f7d2014bd7970b64db99474b30567ccebecbc3c
+++ UI/WebServerResources/UIxMailToSelection.js	01f8c5ff4a8fd72b5bbf7802c09c24912d3149ac
@@ -145,8 +145,30 @@ function addressFieldChanged(event) {
 }
 
 function addressFieldChanged(event) {
+
     var addresses = this.value.split(/[,;]/);
+    
     if (addresses.length > 0) {
+      
+	// Sanitize comma separated string
+	// In some countries the "DisplayName"
+	// is written as "surname, forename <email-adr>"
+	// This will be broken by the simple Regex-split, 
+	// so we have to correct the split.
+	var cAdr = new Array();
+	var str = "";
+	for (var i = 0; i < addresses.length; i++) {
+	    if(emailRE.test(addresses[i])) {
+		    cAdr.push(str + addresses[i]);
+		    str = "";
+	    }
+	    else {
+		    str += addresses[i] + ","; // Mostly comma, very very seldom semicolon
+	    }
+	}
+	
+	addresses = cAdr; // copy corrected array
+      
         var first = true;
         for (var i = 0; i < addresses.length; i++) {
             var words = addresses[i].split(' ');
francis

francis

2011-10-14 20:44

administrator   ~0002913

Fixed in revision 8a9a97e74ab23c27d73459976c2caa29e59adf64. I changed the logic : we now split on commas only if no email address is detected.

Notice that Thunderbird 7 still split unconditionally on commas ..

Issue History

Date Modified Username Field Change
2011-07-28 20:36 mra New Issue
2011-07-28 20:36 mra File Added: screenshot1.png
2011-07-28 20:36 mra File Added: screenshot2.png
2011-07-28 20:37 mra File Added: patch_SOGo_UIxMailToSelection_addressFieldChanged.diff
2011-10-04 20:19 ludovic Relationship added has duplicate 0001436
2011-10-04 20:23 francis Target Version => 1.3.9
2011-10-14 20:44 francis Note Added: 0002913
2011-10-14 20:44 francis Status new => resolved
2011-10-14 20:44 francis Resolution open => fixed
2011-10-14 20:44 francis Assigned To => francis
2011-10-14 20:44 francis Fixed in Version => 1.3.9