[imp] Error displaying messages

Michael M Slusarz slusarz@bigworm.colorado.edu
Fri, 23 Aug 2002 14:42:09 -0600


Quoting Igor Stroh <stroh@scan-plus.de>:

| On Fre, 2002-08-23 at 12:44, Igor Stroh wrote:
| > Hi there,
| >
| > I dont know if it has been reported yet, but consider following
| > situation:
| > Compose mail -> add attachment(s) -> don't write anything in the body
| of
| > the message -> send it.
| > If the recipient opens the mail in IMP, there are neither a body (which
| > is correct) nor any attachments ("There are no parts that can be
| > displyed inline").

Check your mime_drivers setup.  If I send a blank message with a jpeg 
attachment, I correctly get an empty Text part ("There are no parts that 
can be displayed inline") and a link to downloading the jpeg.

| It seems I found the responsible code:
| horde/imp/lib/Contents.php, line 789:
| 
| ...
| if (!empty($msg)) {
| ...
| 
| this causes the renderer to stop the recursion if the message contains
| an empty part, I mean the whole message isn't rendered if only one part
| is empty, but that's kinda wrong, 'cos the message could be multipart
| with an empty body and a whole bunch of attachments... Can someone
| confirm this error? The mail to parse should look like [1]. Notice that
| there are only _two_ blank lines between the first and the second part,
| adding an additional new line would cause the whole stuff to work
| correctly, but unfortunately there are mail clients (mutt for example)
| that send only two new lines if the body is empty... I didn't find
| anything about the required formatting in RFCs, but maybe someone knows
| it better then me :)

The code is correct.  An empty MIME part will never be displayed "inline"; 
since there is nothing to display.  Any embedded/multipart information 
below this part will be correctly handled by the renderMIMEPart() call on 
line 788.

For multipart parts, every individual part within the multipart is sent 
through renderMIMEPart() separately.  Thus there is no "stop the recursion" 
problem.

Additionally, empty MIME parts are identified by the c-client parser (the 
size field contains '?'), not IMP.  So I'm not sure what can be done about 
the "2 vs. 3" blank lines issue.

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder