k-9/src/com/fsck/k9/mail
Joe Steele 1d1db50a9f Don't always base64 encode in BinaryTempFileBody.writeTo
Issue 5734 exemplifies the problem:  receive a message with an attachment
of type message/rfc822 that doesn't use base64 encoding for the body of
the attached message.  K-9 Mail incorrectly stores the attached message
locally with its original headers but using base64 encoding for the body.
A discrepancy thus exists between what the headers say about the encoding
of the body versus the actual encoding used.  This is obvious when
attempting to view the attachment (either by using a compatible message
viewer available on the device or by saving the attachment to a file and
viewing the file contents).

The process: When a message with an attached sub-message is received,
Message.parse puts the attachment in a new MimeMessage with the
attachment's body in a BinaryTempFileBody.  LocalFolder.saveAttachment
then calls Message.writeTo (which later calls BinaryTempFileBody.writeTo)
to place the entire attachment (headers and body) in a new file that will
become a LocalAttachmentBody.  Until now,  BinaryTempFileBody.writeTo
could only save the message body using base64 encoding.

This commit implements BinaryTempFileBody.setEncoding and assures that the
body is written out with the same encoding that was found in its  headers.
2013-09-03 19:51:26 -04:00
..
filter Fix a number of build warnings. 2013-02-04 11:18:49 +01:00
internet Don't always base64 encode in BinaryTempFileBody.writeTo 2013-09-03 19:51:26 -04:00
store Fix erroneous SSL certificate warnings 2013-08-25 15:43:36 -04:00
transport SMTP 8BITMIME compliance 2013-09-03 16:47:57 -04:00
Address.java Avoid race condition that can lead to a NullPointerException 2013-08-21 12:33:27 +02:00
Authentication.java astyle 2011-04-12 22:16:22 +10:00
AuthenticationFailedException.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
Body.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
BodyPart.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
CertificateChainException.java Fix erroneous SSL certificate warnings 2013-08-25 15:43:36 -04:00
CertificateValidationException.java Clean-up related to certificate chains 2013-08-27 18:48:07 -04:00
ConnectionSecurity.java Renamed class StoreSettings to ServerSettings 2011-06-07 16:09:15 +02:00
FetchProfile.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
Flag.java + add support for $Forwarded IMAP flag 2012-08-29 02:26:38 +02:00
Folder.java Koji Arai pointed out that I screwed up the constants for folder open modes 2013-08-25 11:36:25 -04:00
Message.java Strip off signatures from preview. 2013-01-07 10:39:08 +01:00
MessagingException.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
Multipart.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
Part.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
PushReceiver.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
Pusher.java Big, scary massive "ant astyle" to get us back to something 2011-02-06 17:09:48 -05:00
ServerSettings.java Modified ServerSettings to be able to create instances with "extras" 2011-12-01 02:57:53 +01:00
Store.java Add code to remove references to LocalStore when deleting accounts 2013-08-30 03:02:50 +02:00
Transport.java Fix Issue 2389: Self signed certificate expiry causes silent send/receive failure. 2013-01-10 16:49:55 -05:00