6.0.0-alpha12
6/10/25

[#922] Save message as message/rfc822 (.eml) (one-line patch)
Summary Save message as message/rfc822 (.eml) (one-line patch)
Queue IMP
Queue Version 3.2.6
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester bergonz (at) labs (dot) it
Created 12/01/2004 (7496 days ago)
Due
Updated 12/01/2004 (7496 days ago)
Assigned
Resolved 12/01/2004 (7496 days ago)
Milestone
Patch No

History
12/01/2004 08:09:30 PM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
We already had the .eml in HEAD, and I just added the mime type. It'll 
be in IMP 4.0; enhancements aren't being made for IMP 3.x at this point.
12/01/2004 08:48:52 AM bergonz (at) labs (dot) it Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Save message as message/rfc822 (.eml) (one-line patch)
Queue ⇒ IMP
Reply to this comment
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;

   }


Saved Queries