k9mail/k-9 — pull request #374 by zjw (2013-09-04 22:33:35+00:00)
Title: Encoding issues

Fixes:

1. K-9 Mail sends 8 bit data to SMTP servers that support 8BITMIME, but fails to include the required "BODY=8BITMIME" parameter with the MAIL command (commit de23a0e3e1aee48f098ca9edf76cefec83365eaf).

2. As described in [issue 5734](http://code.google.com/p/k9mail/issues/detail?id=5734), when a message with an attachment of type message/rfc822 is received, the attachment ends up being saved in a way where the content-transfer-encoding saved in its headers doesn't match the actual encoding of the saved body (commit 1d1db50a9fa66b551152aa9353dd36b2aa870e30).

3. Whenever a message is sent with a an attachment of type message/rfc822, the attachment is base64 encoded. The RFCs do not permit this. The attachment must use only 7bit or 8bit encoding. Thunderbird refuses to decode and display such attachments. Commit 77407eb5b741f6977fb98bc21c7259d0091d5033 eliminates the base64 encoding and attaches the message with 8bit encoding (not an ideal solution if the SMTP server doesn't support 8BITMIME, but see below).

4. Commit 45e3d8459e912ee88dad4a43f9d24e8aa823e275 fixes the above problem. If an SMTP server does not support 8BITMIME, the message is converted from 8bit to 7bit encoding, This includes recursively processing any attached messages.

The remaining commits fix some minor stuff and provide a unit test.

More detail concerning all these changes can generally be found in the commit messages.