1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00
Go to file
Joe Steele 45e3d8459e Recursively convert attachments of type message/rfc822 to 7bit if necessary.
The preceding commit resulted in attachments of type message/rfc822 being
sent with 8bit encoding even when the SMTP server did not support
8BITMIME.  This commit assures that messages will be converted to 7bit
when necessary.

A new interface CompositeBody was created that extends Body, and classes
Message and Multipart were changed from implementing Body to
CompositeBody.  Additional classes BinaryTempFileMessageBody and
LocalAttachmentMessageBody were created (by extending BinaryTempFileBody
and LocalAttachmentBody, respectively), and they too implement
CompositeBody.

A CompositeBody is a Body containing a composite-type that can contain
subparts that may require recursive processing when converting from 8bit
to 7bit.  The Part to which a CompositeBody belongs is only permitted to
use 8bit or 7bit encoding for the CompositeBody.

Previously, a Message was created so that it was 7bit clean by default
(even though that meant base64 encoding all attachments, including
messages).  Then, if the SMTP server supported 8BITMIME,
Message.setEncoding("8bit") was called so that bodies of type TextBody
would been transmitted using 8bit encoding rather than quoted-printable.

Now, messages are created with 8bit encoding by default.  Then, if the
SMTP server does not support 8BITMIME, Message.setUsing7bitTransport is
called to recursively convert the message and its subparts to 7bit.  The
method setUsing7bitTransport was added to the interfaces Part and
CompositeBody.

setEncoding no longer iterates over parts in Multipart.  That task belongs
to setUsing7bitTransport, which may in turn call setEncoding on the parts.

MimeUtility.getEncodingforType was created as a helper function for
choosing a default encoding that should be used for a given MIME type when
an attachment is added to a message (either while composing or when
retrieving from LocalStore).

setEncoding was implemented in MimeBodyPart to assure that the encoding
set in the Part's headers was the same as set for the Part's Body.  (The
method already existed in MimeMessage, which has similarities with
MimeBodyPart.)

MimeMessage.parse(InputStream in, boolean recurse) was implemented so that
the parser could be told to recursively process nested messages read from
the InputStream, thus giving access to all subparts at any level that may
need to be converted from 8bit to 7bit.
2013-09-03 19:53:13 -04:00
assets SingleMessageView cleanup 2012-04-04 10:04:57 +02:00
compile-only-libs upgrade our android-support library in the hopes that the newer version 2013-07-17 18:36:31 -04:00
docs Added diagram that visualizes activity interactions 2011-10-27 19:13:13 +02:00
images Change appearance of unread widget 2013-03-16 01:57:21 +01:00
libs Use ADT's magic to include the necessary libraries from lib/ 2012-09-08 21:44:49 -07:00
plugins Update ckChangeLog to v1.0.0 2013-07-23 20:28:16 +02:00
res Merge pull request #373 2013-09-02 22:23:56 +02:00
src Recursively convert attachments of type message/rfc822 to 7bit if necessary. 2013-09-03 19:53:13 -04:00
tests Simplify Eclipse setup. 2013-05-31 18:00:45 -04:00
tools Add script to sync localized strings.xml files with the master file 2013-07-09 17:16:23 +02:00
.gitignore Ignore Atlassian config from IntelliJ 2013-07-16 14:55:37 -07:00
.gitmodules Kill our use of submodules dead. They're too painful for new contributors 2012-11-24 17:15:01 -05:00
.project Simplify Eclipse setup. 2013-05-31 18:00:45 -04:00
ActionBarSherlock.iml IntelliJ IDEA: Update android support version per e796468256. 2013-01-09 13:24:30 -08:00
Android-PullToRefresh.iml IntelliJ IDEA: 12.0 updates. 2012-12-18 15:11:47 -08:00
Android.mk Merge ashleywillis' changes in https://github.com/k9mail/k-9/pull/97. 2011-11-14 14:00:15 -08:00
AndroidManifest.xml Bumped manifest to 4.511 2013-08-31 11:57:59 -04:00
ant.properties Upgrade to SDK 15 2012-03-11 14:31:35 -05:00
build_common.xml fixed location of ant-contrib.jar in build_common.xml when running ant from tests/. 2012-06-07 22:57:41 -05:00
build.gradle Update gradle version as required for Android Studio 0.2.x 2013-07-16 15:42:07 +02:00
build.xml Fixes for automated change log publication 2013-08-27 20:28:06 -04:00
ckChangeLog.iml IntelliJ IDEA: Project updates to drag in ckChangeLog. 2013-01-09 13:26:42 -08:00
HoloColorPicker.iml Add pom and IntelliJ configuration for HoloColorPicker 2013-01-17 02:16:24 -08:00
HTMLCLEANER_LICENSE Merge ashleywillis' changes in https://github.com/k9mail/k-9/pull/97. 2011-11-14 14:00:15 -08:00
k9mail.iml Add pom and IntelliJ configuration for HoloColorPicker 2013-01-17 02:16:24 -08:00
k9mail.ipr Add pom and IntelliJ configuration for HoloColorPicker 2013-01-17 02:16:24 -08:00
MODULE_LICENSE_APACHE2 Initial commit - This source code should be EXACTLY what the current version of the 'Email' application in the android repo looks like as of this date. 2008-10-28 01:04:44 +00:00
NOTICE Initial commit - This source code should be EXACTLY what the current version of the 'Email' application in the android repo looks like as of this date. 2008-10-28 01:04:44 +00:00
proguard.cfg Upgrade us to android-14 infrastructure 2011-10-27 12:41:24 -04:00
project.properties Update targetSdkVersion to 17 2013-05-24 22:33:09 +02:00
settings.gradle Add initial Gradle support 2013-06-28 23:59:08 +02:00