[Tickets #922] NEW: Save message as message/rfc822 (.eml) (one-line patch)

bugs at bugs.horde.org bugs at bugs.horde.org
Wed Dec 1 00:48:53 PST 2004


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=922
-----------------------------------------------------------------------
 Ticket     | 922
 Created By | bergonz at labs.it
 Summary    | Save message as message/rfc822 (.eml) (one-line patch)
 Queue      | IMP
 Version    | 3.2.6
 State      | New
 Priority   | 1. Low
 Type       | Enhancement
 Owners     | 
-----------------------------------------------------------------------


bergonz at labs.it (2004-12-01 00:48) wrote:

My users want to save messages in a form that can easily be open from
Windows, but now it is saved as text with no CRs, so doubleclicking it opens
it with notepad, and what the user see is a very garbled thing because of
the pure \n line terminations.

I agree that CRs must be removed, but I do not agree about the MIME type
that is used, so I modified view.php to save as message/rfc822 with
extension .eml . This way both IE and Firefox save the message as a .eml
file, that can later be duobleclicked and seen with Outlook Express.

It is a very trivial one-liner:

*** view.php.orig       2004-12-01 09:15:16.000000000 +0100
--- view.php    2004-12-01 09:28:19.000000000 +0100
***************
*** 111,117 ****
       $body .= imap_body($imp['stream'], $index, FT_UID);
       $body  = str_replace("\r\n", "\n", $body);

!      IMP_Browser::downloadHeaders($name, null, false, strlen($body));
       echo $body;
       exit;
  }
--- 111,117 ----
       $body .= imap_body($imp['stream'], $index, FT_UID);
       $body  = str_replace("\r\n", "\n", $body);

!      IMP_Browser::downloadHeaders($name.'.eml', 'message/rfc822', false,
strlen($body));
       echo $body;
       exit;
  }





More information about the bugs mailing list