Message with only one non-text part

Robin Elfrink elfrink at introweb.nl
Mon Oct 9 11:40:42 CEST 2006


Hello,


I have a message here, generated by some random Exchange server, with
only one mime-part, which is not of type text/* but application/* (excel
in this case).

RoundCube fails to display it, because it assumes that messages with
only one part should have that part as type text/*. Of course I agree
with RoundCube, and I wouldn't be surprised if some RFC does as well,
but my customers don't so I try to have RoundCube show that part as an
attachment.

I have modified the following in program/steps/mail/func.inc:

@@ -981,6 +982,17 @@
         }
       }
     }
+  else
+    {
+      if (($fname = $structure->d_parameters['filename']) ||
+          ($fname = $structure->ctype_parameters['name']) ||
+          ($fname = $structure->headers['content-description']))
+        {
+          $structure->filename = rcube_imap::decode_mime_string($fname);
+             $structure->mimetype = $message_ctype_primary . '/' .
$message_ctype_secondary;
+          $a_attachments[] = $structure;
+        }
+    }

   return array($a_return_parts, $a_attachments);
   }


The single non-text part is now shown as attachment, and can be
retrieved by the client, but the content-decoding still needs to be done.

Two questions:
1. Is this the right thing, the right place and the right solution?
2. How do I get RoundCube to use the proper decoding for the part?



Robin





More information about the Dev mailing list