attachment problem

George Wu geo at mis.ASUC.Berkeley.EDU
Thu Aug 10 03:43:35 CEST 2006


There is a bug with roundcube where attachments don't get correctly displayed.

This happens when a user sends email with an attachment via Apple Mail client to a user using roundcube. Although the email is viewable there is no attachment. Forwarding and saving to drafts correctly displays an attachment as well as forwarding to anyone else.



diff -uNr rev304/roundcubemail/program/steps/mail/func.inc rev304-fixed/program/steps/mail/func.inc

--- rev304/roundcubemail/program/steps/mail/func.inc    2006-08-08 16:27:06.000000000 -0700

+++ /var/www/lolamail/program/steps/mail/func.inc       2006-08-09 10:53:10.000000000 -0700

@@ -426,7 +426,8 @@

       $message_icon = $attrib['messageicon'];



        // set attachment icon

-    if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype))

+//    if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype))

+    if ($attrib['attachmenticon'] && preg_match("/multipart\//i", $header->ctype))

       $attach_icon = $attrib['attachmenticon'];



     $out .= sprintf('<tr id="rcmrow%d" class="message%s%s %s">'."\n",

@@ -875,7 +876,8 @@

     }



   // message contains multiple parts

-  else if ($message_ctype_primary=='multipart' && is_array($structure->parts))

+  // else if ($message_ctype_primary=='multipart' && is_array($structure->parts))

+  if ($message_ctype_primary=='multipart' && is_array($structure->parts))

     {

     foreach ($structure->parts as $mail_part)

       {



I've commented out the lines in question that cause this bug and replaced them with lines that do show the attachment. Is there a reason why lines 813 and down aren't under line 878 (i.e. nested if)? Also I can send out an email via Apple Mail if anyone is interested. Basically Apple Mail uses multipart/alternative as default and an attachment is contained after it.



- George





More information about the Dev mailing list