[patch] Unable to view attachments in IMP 2.2.7

Gergely Tamas dice@mfa.kfki.hu
Tue, 13 Nov 2001 19:37:58 +0100 (CET)


Hi!

Yesterday, after upgrading to IMP 2.2.7 I noticed the following problem:

| If I try to save the attachment from a mail, I get a server
| misconfigured error.

I had this error also with 2.2.5 (I don't tried 2.2.6, sorry), and sent a
fix to Charles J. Hagenbuch [chuck@horde.org], who was mentioned as the
author at the header of IMP php files. Unfortunately I got not response to
my mail, and as mentioned above, this bug still exists in 2.2.7 .

So I try to resend my letter from June. This patch fixes this issue
also for 2.2.7.

Thanks in advance,
Gergely Tamas

-----------------------------------------------

Date: Wed, 13 Jun 2001 15:01:04 +0200 (CEST)
From: Gergely Tamas <dice@mfa.kfki.hu>
To: "Charles J. Hagenbuch" <chuck@horde.org>
Subject: [patch] Unable to view attachments in IMP 2.2.5

Hi!

Our users reported that they are unable to save attachments in our
IMP 2.2.5 based webmail.

Every time they tried to save a part of their message, they got a 'server
misconfigured' error, and APACHE logged 'Premature end of script headers:
/usr/lib/cgi-bin/php4'.

So I had a look at it, and noticed that there may be an error / typo in
the imp/mimetypes.lib file.

The following patch fixed it...

Thanks,
Gergely

--- mimetypes.lib-orig	Thu May 31 17:14:23 2001
+++ mimetypes.lib	Wed Jun 13 14:46:43 2001
@@ -167,7 +167,7 @@
     // FIXME: (dependancy on imp)
     global $imp, $index; $mailbox = $imp->mailbox;
     if ($mime->conf['download'])
-      $row .= '<td><a href="' . $sess->url('view.php3/' . urlencode(decode_mime_string($mime->name)) . '?mailbox=' . urlencode($mailbox)) . "&index=$index&bodypart=$mime->imap_id&actionID=" . DOWNLOAD_ATTACH . '"><img src="' . $default->graphics_url . '/download.gif" alt="' . $lang->imp->download . '" border="0"></a></td>';
+      $row .= '<td><a href="' . $sess->url('view.php3?mailbox=' . urlencode($mailbox)) . "&index=$index&bodypart=$mime->imap_id&actionID=" . DOWNLOAD_ATTACH . '"><img src="' . $default->graphics_url . '/download.gif" alt="' . $lang->imp->download . '" border="0"></a></td>';
     else
       $row .= '<td>&nbsp;</td>';