Summary | Wrong transfer encoding after stripping attachments |
Queue | IMP |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | slusarz (at) horde (dot) org |
Requester | jan (at) horde (dot) org |
Created | 09/19/2008 (6109 days ago) |
Due | |
Updated | 01/12/2010 (5629 days ago) |
Assigned | |
Resolved | 12/18/2008 (6019 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Fix
Ticket #7361- content-encoding on stripAlso, general fixes to stripping code (was broken in transition to IMP
5)
Rework stripping algorithm - only allow stripping non-body parts; and
only allow stripping of entire part - not subparts (since subparts may
be required to view parent part). Still a WIP.
http://git.horde.org/diff.php/imp/lib/Contents.php?rt=horde-git&r1=a5de175a9ee0c9d9d30123e1ce3321053285daa1&r2=150496c410d7c650a6e955c8bca758543f90341e
http://git.horde.org/diff.php/imp/lib/Message.php?rt=horde-git&r1=b0b3bce69358f5bed078c5cda76cd912aaf390f2&r2=150496c410d7c650a6e955c8bca758543f90341e
http://git.horde.org/diff.php/imp/message.php?rt=horde-git&r1=a5de175a9ee0c9d9d30123e1ce3321053285daa1&r2=150496c410d7c650a6e955c8bca758543f90341e
attachment are base64 encoded. When stripping attachments the mail is
copied over with the attachments stripped out and imp changes the mail
body encoding to quoted-printable which renders the mail unreadable
for the user.
The problem starts when on line 566 of horde/imp/lib/Message.php
imap_append is called with $contents->toString($message,true) as one
of the parameters. This call ends up(after several strange twists) in
horde/lib/Horde/MIME/Part.php and it's getTransferEncoding-function.
Within the second case 'text' elseif tries to find line feeds that
have more than 998 characters in between them or 998 characters before
"\n"-characters. After inserting some additional logging I found out
that the mail has "^M" instead of "\n" at this point and so the
regexp returns true every time if the mail is longer than 998
characters.
I fixed this by adding && $encoding!='base64' to the elseif-statement.
I have not tried the latest imp5 edition so I'm not sure if this is
fixed in it. Also I'm not 100% sure that this doesn't brake something
else so use at your own risk.
State ⇒ Resolved
New Attachment: Falsche Adresse ist aber immer noch da anonymous.eml
for me with the attached message.
Priority ⇒ 2. Medium
Patch ⇒ No
Milestone ⇒
Assigned to Michael Slusarz
Summary ⇒ Wrong transfer encoding after stripping attachments
Type ⇒ Bug
State ⇒ Assigned
Queue ⇒ IMP
it's always too late to check the preconditions when I see this. But
sometime, if I strip (all) attachments from a message, the message
body is rendered as base64 code.
I'm not sure whether the original message body was base64 encoded and
the Content-Transfer is wrong after the stripping, or the transfer
encoding changed to base64 during the stripping.