Tracker: Patches

5 base64 encode attach with invalid line lengths (bug 1473714) - ID: 2226470
Last Update: Comment added ( pdontthink )

Diffed against current subversion class/deliver/Deliver.class.php revision
13067

Fixes bug 1473714. Patch to Delivery.class.php. Current behavior of
writeBodyPart is to 8bit encode attachments of content-type text and
content-type message. In circumstances where the attachment has lines
greater than 998 characters this results in non rfc 2822 2.1.1 (Line Length
Limits) compliant attachments.

The current stable Cyrus IMAP (2.2.12) will choke on these long lines if
they are in the neighborhood of 9000 characters and longer, and will reject
delivery with a 554 5.6.0 Message contains NUL characters (in reply to end
of DATA command))

I found this to be an issue for users using SquirrelMail to forward and
reply to mail with that was delivered to them text/html attachments that
lacked line breaks.

This patch will base64 encode message parts with attachment filenames even
if they are of content type text or content type message.

Functions writeBodyPart and prepareMIME_Header were updated.


Kelly Fallon ( kellyfallon ) - 2008-11-05 20:14

5

Closed

Accepted

Nobody/Anonymous

Attachments

None

Public


Comments ( 4 )

Date: 2009-04-03 08:47
Sender: pdontthinkProject AdminAccepting Donations

Not sure why you are using 1.4.9 - perhaps it's a Debian package. I'd
recommend downloading from our site directly, since otherwise you are not
likely to see this or other fixes any time soon... and we only support our
unmodified (not downstream) product here (and that's what we'd like patches
to be against as well).

In any case, thanks very much for your help. A slightly modified version
of this patch has been applied to both 1.4.18SVN and 1.5.2SVN.

Let us know if you see any problems with it. Thanks again!



Date: 2008-11-12 20:36
Sender: kellyfallon

File Added: SquirrelMail-1.4.9a-2_attachment_encoding.patch


Date: 2008-11-06 19:07
Sender: kellyfallon

Adding patch for squirrelmail-1.4.9a to selectively base64 encode
attachments with over long lines.

File Added: SquirrelMail-1.4.9a-2_attachment_encoding.patch


Date: 2008-11-06 17:57
Sender: kellyfallon

Updated version of this patch that will selectively base64 encode only the
text/message attachments that have long lines instead of all of them.
Added new function hasLongLines to Deliver class.

File Added: selectively_base64_encode_attch_with_long_lines.patch


Attached Files ( 2 )

Filename Description Download
selectively_base64_encode_attch_with_long_lines.patch Download
SquirrelMail-1.4.9a-2_attachment_encoding.patch updated patch to base64 encode attachments with long lines Download

Changes ( 9 )

Field Old Value Date By
status_id Open 2009-04-03 08:47 pdontthink
close_date - 2009-04-03 08:47 pdontthink
resolution_id None 2009-04-03 08:47 pdontthink
File Added 301147: SquirrelMail-1.4.9a-2_attachment_encoding.patch 2008-11-12 20:36 kellyfallon
File Deleted 300440: 2008-11-12 20:35 kellyfallon
File Deleted 300312: 2008-11-06 19:08 kellyfallon
File Added 300440: SquirrelMail-1.4.9a-2_attachment_encoding.patch 2008-11-06 19:07 kellyfallon
File Added 300432: selectively_base64_encode_attch_with_long_lines.patch 2008-11-06 17:57 kellyfallon
File Added 300312: invalid_line_length.patch 2008-11-05 20:14 kellyfallon