6.0.0-beta1
8/3/25

[#1463] Message previews sometimes show MIME-glut
Summary Message previews sometimes show MIME-glut
Queue IMP
Queue Version 4.0.2
Type Bug
State Resolved
Priority 1. Low
Owners
Requester oliver (at) gtwebmarque (dot) com
Created 03/01/2005 (7460 days ago)
Due
Updated 03/01/2005 (7460 days ago)
Assigned
Resolved 03/01/2005 (7460 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/01/2005 04:16:59 PM Jan Schneider Comment #2
State ⇒ Resolved
Reply to this comment
This has been implemented in CVS already and will be released with IMP 4.1.
03/01/2005 04:01:45 PM oliver (at) gtwebmarque (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Message previews sometimes show MIME-glut
Queue ⇒ IMP
Reply to this comment
Some messages contain information at the top about the MIME parts, see 
the sample at the end for an example. This causes message previews to 
display this ugly text instead of the start of the actual message.



A partial fix/hack is to remove the MIME info from the preview with a 
regex. In horde/imp/lib/Mailbox.php, after line

294: $ptext = trim(strip_tags(@imap_fetchbody($imp['stream'], 
$header->msgno, 1)));

insert the line

$ptext = preg_replace('/^.*Content\-Transfer\-Encoding\:.*?\n/s', '', 
$ptext, 1);



This only works if the first message part, that imap_fetchbody fetches 
is the plain text part. If it is an attachment or something then we 
can never get the text from it. To handle all situations, we'd have to 
add in some code to make sure we fetch the plain-text part of the 
message (if there is one of course) to use for the preview.



** BEGIN MESSAGE SAMPLE **

This is a multi-part message in MIME format.

--------------050807000301030204090007

Content-Type: multipart/alternative;

  boundary="------------010801040006060501020508"





--------------010801040006060501020508

Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Content-Transfer-Encoding: 7bit

** END MESSAGE SAMPLE **

Saved Queries