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 |
State ⇒ Resolved
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Message previews sometimes show MIME-glut
Queue ⇒ IMP
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 **