[imp] Error displaying messages

Igor Stroh stroh@scan-plus.de
23 Aug 2002 17:48:09 +0200


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"). I know the code for this problem is located somewhere
> in imp/lib/Contents.php but I can't find the piece that's causing this
> behaviour. Could someone point me to the right direction? It's really
> urgent, please help.

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 :)

To fix this issue, I commented out the "if" statement and it seems to
work, though I have no idea if I've broken something else with this
"fix"...

greetings,
Igor

[1]:
[headers]
...
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=_08818b4bc964ab14997d596c"
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs

This message is in MIME format.

--=_08818b4bc964ab14997d596c
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 7bit


--=_08818b4bc964ab14997d596c
Content-Type: application/octet-stream; name="<filename>"
Content-Disposition: attachment; filename="<filename>"
Content-Transfer-Encoding: base64

[base64 encoded stuff]

--=_08818b4bc964ab14997d596c--