Index: CHANGELOG
===================================================================
--- CHANGELOG	(revision c435173eb411b9fb6a5f7c17cd408fb6591df111)
+++ CHANGELOG	(revision 9d5c834332e553429b5b4c700acea6927d496d6a)
@@ -2,4 +2,5 @@
 ===========================
 
+- Fix %00 character in winmail.dat attachments names (#1486738)
 - Fix handling errors of folder deletion (#1486705)
 - Parse untagged CAPABILITY response for LOGIN command (#1486742)
Index: program/include/rcube_imap.php
===================================================================
--- program/include/rcube_imap.php	(revision c435173eb411b9fb6a5f7c17cd408fb6591df111)
+++ program/include/rcube_imap.php	(revision 9d5c834332e553429b5b4c700acea6927d496d6a)
@@ -3394,11 +3394,11 @@
         foreach ($tnef_arr as $winatt) {
             $tpart = new rcube_message_part;
-            $tpart->filename = $winatt["name"];
+            $tpart->filename = trim($winatt['name']);
             $tpart->encoding = 'stream';
-            $tpart->ctype_primary = $winatt["type0"];
-            $tpart->ctype_secondary = $winatt["type1"];
-            $tpart->mimetype = strtolower($winatt["type0"] . "/" . $winatt["type1"]);
+            $tpart->ctype_primary = trim(strtolower($winatt['type0']));
+            $tpart->ctype_secondary = trim(strtolower($winatt['type1']));
+            $tpart->mimetype = $tpart->ctype_primary . '/' . $tpart->ctype_secondary;
             $tpart->mime_id = "winmail." . $part->mime_id . ".$pid";
-            $tpart->size = $winatt["size"];
+            $tpart->size = $winatt['size'];
             $tpart->body = $winatt['stream'];
 
