1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00
Commit Graph

85 Commits

Author SHA1 Message Date
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
cketti
9ea46cf03b Merge branch 'Issue_4019_pinch_zoom'
Conflicts:
	src/com/fsck/k9/view/MessageWebView.java
2013-03-19 21:09:23 +01:00
cketti
0319ee4a5d Move KOI8-U -> KOI8-R fixup to charset fall-back table 2013-03-10 09:55:25 +01:00
cketti
4b42d0e062 Code cleanup 2013-03-10 09:39:03 +01:00
eagan
c5802ed8ef Java5 style 'for' 2013-03-10 09:25:28 +01:00
eagan
a5f4ddae91 Enhancement for charset fallback.
Fallback rule is defined in CHARSET_FALLBACK_MAP.
Multi-level fallback is supported.
2013-03-10 09:25:13 +01:00
Joe Steele
6a844a2553 Remove unused code in HtmlConverter.
HtmlConverter.getHtmlHeader() and getHtmlFooter() are
no longer used.  Remove them and other related code.
2013-03-01 14:30:42 -05:00
Joe Steele
e2c5229e85 Change when <html> tags are applied to messages.
Previously, <html>, <head>, & <body> tags were
attached to messages before they were stored locally.
But now that the <head> element also needs to include
a <meta> element (for proper MessageWebView display),
it seems unecesary to store all these tags with each
message.

Now the tags are no longer stored with the messages.  Instead,
MessageWebView applies the tags before displaying the message.

This also eliminates the need to upgrade an older
message database where all the old messages would have
otherwise needed to be wrapped with the new tags.
2013-03-01 12:59:59 -05:00
cketti
3253466f14 More magic to work around BinaryTempFileBodyInputStream 2012-09-09 01:15:26 +02:00
cketti
5678786c97 Properly closing InputStreams to avoid StrictMode warnings 2012-09-05 05:57:52 +02:00
cketti
602ce7be99 Trim the first value in getHeaderParameters()
Previously a value like 'text/html ; charset="windows-1251"' for the
Content-Type header would not be decoded correctly.

Fixes issue 4348
2012-06-18 04:46:46 +02:00
cketti
116e9598da Create an HTML version of text/plain-only drafts in the database
Without this, text/plain-only messages with K-9 Mail's "identity header"
are displayed as "No text" (when moved out of the Drafts folder).
2012-06-01 16:15:07 +02:00
Jesse Vincent
85da3d8667 workaround to detect the charset from HTML mail without charset parameter on the header.
Conflicts:

	src/com/fsck/k9/mail/internet/MimeUtility.java
2012-04-08 12:38:45 -04:00
Koji Arai
10c37942a6 Added two domains handle docomo emoji 2012-03-17 23:24:12 +09:00
Koji Arai
f9fb74241a avoid NPE. address may be null when the parser is failed. 2012-03-17 23:23:27 +09:00
cketti
f9a35aeaee Replace CRLF with LF when loading drafts
This is necessary because we save the offset and length of the user-
supplied text in the identity header. These values are then later used
to split the draft in user text and quoted message.
When calculating these values we operate on a string with LF line
endings. Ideally we want to do the reverse operation on the same
string, but when saving the message to the server LF is converted to
CRLF to create RFC-conforming messages.

This is only a hack and will probably be the cause of more trouble in
the future. A better solution would be to make the identity header more
robust or get rid of it entirely.
2012-03-17 04:15:30 +01:00
cketti
3fa8081e88 Fixed MimeUtility.extractTextual() when loading messages from the server 2012-03-17 03:19:09 +01:00
cketti
dbf38dae65 Fixed the change of the previous commit 2012-03-17 00:30:40 +01:00
cketti
a48adafbbc Don't use null for 'text' and 'html' in ViewableContainer 2012-03-16 22:56:09 +01:00
cketti
f181e923ca Don't modify draft messages when storing them in the database 2012-03-15 21:21:00 +01:00
cketti
aeb0220e56 Fixed MimeUtility.getHeaderParameter() to not crash on unexpected input 2012-03-12 17:45:34 +01:00
cketti
2cb31a2fac Added button to show unnamed and inline attachments 2012-02-27 21:45:46 +01:00
cketti
b9803ece19 Fixed divider before text part with filename 2012-02-18 00:05:56 +01:00
cketti
8ce78408c2 Fixed HTML generation in MimeUtility.extractTextAndAttachments() 2012-02-17 19:42:35 +01:00
cketti
cf9631d481 Changed the way we decide what message parts to display 2012-02-13 23:11:59 +01:00
edpeur
daeedc2222 Close resources properly 2011-12-31 17:38:41 +00:00
cketti
20eab9c812 Rewrite application/x-zip-compressed to application/zip 2011-11-21 11:49:03 +01:00
cketti
4f060642ee Merge branch 'imap_parser' 2011-11-16 04:52:05 +01:00
cketti
70dc27c481 Make MimeUtility.getMimeTypeForViewing() return lower case MIME types
MIME type matching in Android is case-sensitive. So we convert the MIME
types we read from the email to lower case.
2011-11-06 02:05:47 +01:00
cketti
88a2dd6289 Merge branch 'issue549'
Conflicts:
	src/com/fsck/k9/Account.java
	src/com/fsck/k9/mail/store/WebDavStore.java
2011-11-05 18:47:55 +01:00
Andrew Chen
f884e967c9 Use MimeHeader.* constants when referring to content headers. Minor whitespace changes. 2011-11-02 08:34:06 -07:00
cketti
807907cb9e Merge branch 'master' into issue549
Conflicts:
	res/values/strings.xml
	src/com/fsck/k9/service/MailService.java
2011-10-29 05:22:07 +02:00
cketti
b69d6cb64c Use Locale.US with toUpperCase() and toLowerCase() where appropriate 2011-10-27 17:17:43 +02:00
cketti
fc8d2e9979 Merge branch 'master' into issue549
Conflicts:
	res/menu/accounts_context.xml
	res/menu/accounts_option.xml
	res/values/strings.xml
	src/com/fsck/k9/Account.java
	src/com/fsck/k9/activity/Accounts.java
	src/com/fsck/k9/activity/AsyncUIProcessor.java
	src/com/fsck/k9/activity/FolderList.java
	src/com/fsck/k9/activity/ImportListener.java
	src/com/fsck/k9/activity/K9Activity.java
	src/com/fsck/k9/activity/K9ListActivity.java
	src/com/fsck/k9/activity/MessageView.java
	src/com/fsck/k9/mail/store/ImapStore.java
	src/com/fsck/k9/mail/store/Pop3Store.java
	src/com/fsck/k9/mail/store/WebDavStore.java
	src/com/fsck/k9/mail/transport/SmtpTransport.java
2011-10-14 20:33:25 +02:00
Apoorv Khatreja
021d5641e5 ant astyle 2011-07-17 01:40:20 +05:30
cketti
d310167b99 Rewrite mime type image/pjpeg to image/jpeg
Fixes issue 1712
2011-07-07 03:05:12 +02:00
Bernhard Redl
f2283aa91e Catch IllegalCharsetNameException causing force-close on unsupported japanese charsets (issue 3272) 2011-05-01 04:32:10 +02:00
Jesse Vincent
0174988d27 astyle 2011-04-12 22:16:22 +10:00
cketti
0aa03ccdc4 Extract MIME type fixup code to method MimeUtility.getMimeTypeForViewing() 2011-03-25 00:37:53 +01:00
cketti
f3e4618702 Cosmetic + documentation changes 2011-03-24 23:04:58 +01:00
Apoorv Khatreja
168f6277da Mime type rewriting must be done only when an attachment is viewed. Therefore, removed conflicting references to rewriting code from LocalStore. 2011-03-25 05:46:11 +08:00
Apoorv Khatreja
80d99baf29 Implemented table lookup for mime type replacement (issue 873 and similar), added javadocs, moved to MimeUtility.java. 2011-03-25 05:46:11 +08:00
danapple
8e5c50a8ef astyle 2011-03-20 15:21:24 -05:00
danapple
fdb38da2e5 Discourage accidental deletion of essential mime types. 2011-03-02 19:28:36 -06:00
danapple
107408c0d9 K-9 Mail now opens the Accounts Activity when started with an Intent
with an enclosed URI with a content type of application/x-k9settings.
This allows a user to bootstrap K-9 Mail configuration by email a
settings file from one device to another, perhaps using a GMail
account on the receiving end.
2011-03-01 22:34:41 -06:00
danapple
88f6034cbb When emailing a K-9 settings export file, use specific special content type. 2011-03-01 21:43:11 -06:00
Jesse Vincent
bb1e66c70d If android's content-type lookup says "why yes, I have no idea what that
is", at least look at our local list
2011-02-07 20:33:46 -05:00
Jesse Vincent
12d1097a24 Big, scary massive "ant astyle" to get us back to something
approximating AOSP coding standards.
2011-02-06 17:09:48 -05:00
Jesse Vincent
8329a0287b Upgrade to mime4j. "0.7" branch as of
http://svn.apache.org/repos/asf/james/mime4j/trunk@1058339
2011-01-19 21:32:09 +00:00
cketti
8279092070 Fixed lots of warnings (unused imports/variables, missing annotations, etc.) 2011-01-18 23:54:49 +00:00