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

192 Commits

Author SHA1 Message Date
Danny Baumann
275700e482 Fix a number of build warnings.
This gets rid of about 50 warnings. Deprecation warnings still remain,
though.
2013-02-04 11:18:49 +01:00
Andrew Chen
5ac3d1d5c2 Use existing LocalMessage for the JB notifications.
LocalMessage already has a content preview in it; reuse that.
Remove unneeded MimeMessage#getPreview() method now that we don't need
to generate a preview anymore.
2013-01-07 23:20:35 -08:00
Danny Baumann
6f7ec3e401 Incorporate review comments. 2013-01-05 13:21:17 +01:00
luyang
bbdec62e37 Fix for StrictMode error.
When the device lost connectivity, a StrictMode error could be thrown since
the stream was never closed.
2012-11-28 19:55:42 +01:00
cketti
ec76dca57f Remove unused stuff 2012-10-24 01:37:33 +02:00
Jesse Vincent
0c34a21ff0 Add a fromMe method on messages 2012-10-03 21:56:28 -04:00
Rob Bayer
fdb1267cb1 Add remote IMAP search support.
* rbayer/IMAPsearch: (21 commits)
  More cleanup
  Code Cleanup getRemoteSearchFullText -> isRemoteSearchFullText line wraps for preference items
  Refactor to allow fetching of extra search results beyond original request.  Most code moved out of ImapStore and ImapFolder and into MessagingController.searchRemoteMessagesSynchronous.  Should make it easier to add remoteSearch for other server types.
  Prevent delete of search results while search results open
  remove duplicated code block
  Don't hide Crypto when IMAPsearch disabled
  Code Style Cleanup: Tabs -> 4 spaces Remove trailing whitespace from blank lines
  tabs -> spaces (my bad...)
  Fix opening of folders to be Read-Write when necessary, even if they were previously opened Read-Only.
  add missing file
  Working IMAP search, with passable UI.
  UI improvements
  Simple help info when enabling Remote Search
  Dependency for preferences
  Basic IMAP search working
2012-09-13 09:10:37 -07: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
Bernhard Redl
89f6c2f6d0 upgraded Mime4J 0.7-SNAPSHOT -> 0.7.2 (fixes MimeMultipart parser bug) 2012-08-15 01:47:57 +02:00
András Veres-Szentkirályi
57f364ca69 combined nested if statements in MimeHeader.hasToBeEncoded 2012-07-06 14:35:01 +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
ashley willis
9e1fa63139 fixed MimeHeader.hasToBeEncoded() to include TAB.
bug encounted when replying to a message such as:
From: "bar,	foo" <foobar@example.com>
the field was originally folded on the tab, but the CRLF was already stripped before this error.
2012-04-30 13:58:02 -05: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
cketti
71174417ce Clone Message object to avoid ConcurrentModificationExceptions
Fixes issue 3953
2012-01-04 03:57:53 +01:00
edpeur
daeedc2222 Close resources properly 2011-12-31 17:38:41 +00:00
Andrew Gaul
e93510b4b3 Avoid string concatenation in Writer.write 2011-11-27 13:57:11 -08: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
Jesse Vincent
a8ef6594ec Preserve header order (with the exception of duplicate headers like
"received" they all show up where the first one did
2011-11-15 00:00:42 -05: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
57e0abbf8f Merge pull request #84 from andrewgaul/api7
Use LinkedList instead of Deque.
2011-11-03 07:41:09 -07:00
Andrew Gaul
98d0b61890 API 7 fixes 2011-11-02 20:47:48 -07:00
Andrew Gaul
647ae0a31c Prefer Collection.isEmpty over size 2011-11-02 20:03:07 -07:00
Andrew Chen
f884e967c9 Use MimeHeader.* constants when referring to content headers. Minor whitespace changes. 2011-11-02 08:34:06 -07:00
Andrew Chen
ea05f3b5d0 Merge branch 'legacy-collections' of https://github.com/andrewgaul/k-9 into andrewgaul
* 'legacy-collections' of https://github.com/andrewgaul/k-9:
  Prefer unsynchronized Collection types
2011-11-01 13:26:54 -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
9327c86fe7 Use Locale.US when calling toUpperCase() on the generated MIME boundary
Fixes issue 3733
2011-10-27 16:52:27 +02:00
Andrew Gaul
e394924ce4 Prefer Random.nextInt over Math.random
Addresses a FindBugs complaint.
2011-10-25 21:21:23 -07:00
Andrew Gaul
80d9246130 Prefer unsynchronized Collection types 2011-10-19 21:56:20 -07: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
Andrew Gaul
47eb0fa2e1 Prefer StringBuilder over StringBuffer
The former is unsynchronized and slightly faster.
2011-10-05 21:50:31 -07:00
Jesse Vincent
3679b31b12 Workaround for market-reported error:
java.lang.Error: org.apache.james.mime4j.io.MaxHeaderLimitException: Maximum header limit exceeded
at com.kaitenmail.mail.internet.MimeMessage.parse(MimeMessage.java:85)
at com.kaitenmail.mail.store.Pop3Store$Pop3Message.parse(Pop3Store.java:932)
at com.kaitenmail.mail.store.Pop3Store$Pop3Folder.fetchBody(Pop3Store.java:714)
at com.kaitenmail.mail.store.Pop3Store$Pop3Folder.fetch(Pop3Store.java:579)
at com.kaitenmail.controller.MessagingController.downloadSmallMessages(MessagingController.java:1562)
at com.kaitenmail.controller.MessagingController.downloadMessages(MessagingController.java:1288)
at com.kaitenmail.controller.MessagingController.synchronizeMailboxSynchronous(MessagingController.java:1031)
at com.kaitenmail.controller.MessagingController.access$400(MessagingController.java:81)
at com.kaitenmail.controller.MessagingController$8.run(MessagingController.java:823)
at com.kaitenmail.controller.MessagingController.run(MessagingController.java:276)
at java.lang.Thread.run(Thread.java:1096)
Caused by: org.apache.james.mime4j.io.MaxHeaderLimitException: Maximum header limit exceeded
at org.apache.james.mime4j.stream.AbstractEntity.parseField(AbstractEntity.java:153)
at org.apache.james.mime4j.stream.MimeEntity.advance(MimeEntity.java:120)
at org.apache.james.mime4j.stream.MimeTokenStream.next(MimeTokenStream.java:351)
at org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:179)
at com.kaitenmail.mail.internet.MimeMessage.parse(MimeMessage.java:83)
... 10 more
2011-07-25 01:49:42 -04: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
Jesse Vincent
2a698f1ab9 ant astyle 2011-07-02 15:18:43 -04:00
cketti
222cd43c80 Some code cleanup. No functional changes. 2011-06-17 04:13:32 +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
Jesse Vincent
e19162cb86 ant astyle 2011-03-22 18:07:47 +11:00
danapple
8e5c50a8ef astyle 2011-03-20 15:21:24 -05:00
HIRANO Takahito
6c37741e63 Could not handle iso-2022-jp streams which contain continuous escape
sequences.

Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-03-19 18:05:07 +09:00
danapple
fdb38da2e5 Discourage accidental deletion of essential mime types. 2011-03-02 19:28:36 -06:00
danapple
32b5afc702 astyle 2011-03-02 07:34:54 -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
Koji Arai
da34a5ec8c Avoid IllegalArgumentException for Charset.forName(null). 2011-03-02 00:59:20 +09:00
cketti
ea590cbe39 Removed unused import + constant 2011-02-20 06:25:19 +01:00
HIRANO Takahito
580d19ec17 Allow emoji input in subjects.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-02-20 10:15:50 +09: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
ff0f517cbb Configure MIME4J to not die when there are long header lines or a large message header 2011-02-01 20:48:20 +00:00
cketti
bec094326a Make decodeQ() actually use the "fixed up" string. Will fix Q-encoded subjects where space is encoded as "_".
Fixes issue 2926
2011-01-30 03:00:46 +00:00
HIRANO Takahito
07814db9f4 Fix range check for ISO-2022-JP stream.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-01-29 17:56:58 +00:00
Jesse Vincent
a234c39722 astyle 2011-01-19 21:33:23 +00: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
7119c7165f Removed unnecessary type casts 2011-01-19 01:21:27 +00:00
cketti
8279092070 Fixed lots of warnings (unused imports/variables, missing annotations, etc.) 2011-01-18 23:54:49 +00:00
Jesse Vincent
aacb414004 astyle 2011-01-14 01:37:52 +00:00
Jesse Vincent
d1a1b12aae Support emoji in subjects.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-01-14 00:53:19 +00:00
Andrew Chen
e56b044bbc Add support for HTML composition with text alternative.
Revamp K9 Identity string.
Quote names in Address only when needed.
Remove quoted text bar and move button to quoted text area.
2011-01-12 23:48:28 +00:00
Jesse Vincent
de806f7715 astyle 2011-01-06 16:55:08 +00:00
Jesse Vincent
2daf8eaec8 Allow emoji input.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
2011-01-04 13:25:59 +00:00
Jesse Vincent
40344aea41 support iPad mail too 2011-01-03 18:12:35 +00:00
Jesse Vincent
0a8514888e Map emoji code points defined by mobile carriers to ones defined by
Google in order to support various carriers. Patch by HIRANO Takahito
<hiranotaka@zng.info>
2011-01-03 18:07:44 +00:00
Jesse Vincent
f14c7ecd9b doc & comment updates from achen.code 2010-12-25 00:27:09 +00:00
Fiouz
fb348449c3 Don't reference the enclosing type instance when it's not used (memory optimisation) 2010-12-14 19:26:44 +00:00
Jesse Vincent
f5eb6e03af astyle 2010-12-01 06:32:29 +00:00
Jesse Vincent
c79ea226a5 Remove "throws" declarations that didn't actually get thrown. Remove a
couple of try blocks that only caught throws we didn't throw. IntelliJ
optimization.
2010-12-01 03:02:13 +00:00
Jesse Vincent
81f12f0e05 clean up a couple null checks 2010-12-01 03:01:20 +00:00
Jesse Vincent
621f87fcbc Revert "refactor getHeaders and removeHeaders to use a common method and an"
Subtly flawed. Returned the wrong headers

This reverts commit 657b3961f86b1b694fb7587216ecefeb0b20f5d2.
2010-11-27 04:03:15 +00:00
Jesse Vincent
1149f2d916 refactor getHeaders and removeHeaders to use a common method and an
iterator to address a Market FC:

java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
at com.fsck.k9.mail.internet.MimeHeader.getHeader(MimeHeader.java:87)
at
com.fsck.k9.mail.internet.MimeHeader.getFirstHeader(MimeHeader.java:51)
at
com.fsck.k9.mail.internet.MimeMessage.getFirstHeader(MimeMessage.java:437)
at
com.fsck.k9.mail.internet.MimeMessage.getContentType(MimeMessage.java:130)
at
com.fsck.k9.mail.internet.MimeMessage.getMimeType(MimeMessage.java:159)
at
com.fsck.k9.mail.internet.MimeUtility.findFirstPartByMimeType(MimeUtility.java:971)
at com.fsck.k9.crypto.Apg.isEncrypted(Apg.java:464)
at
com.fsck.k9.activity.MessageView.updateDecryptLayout(MessageView.java:2702)
at
com.fsck.k9.activity.MessageView$Listener$6.run(MessageView.java:2466)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
2010-11-26 03:53:15 +00:00
Jesse Vincent
14055691a3 Merge branch 'mail-on-sd'
* mail-on-sd: (40 commits)
  Added more comments to explain how the locking mecanism works for LocalStore
  Fixed wrong method being called during experimental provider initialization (since provider isn't enabled, that didn't harm)
  Add more comments about how the various StorageProviders work and how they're enabled
  find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
  French localization for storage related settings
  Remove unused SD card strings (replaced with storage indirection)
  Merge mail-on-sd branch from trunk
  Reset mail service on storage mount (even if no account uses the storage, to be improved)
  find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
  Migraion -> Migration
  move the Storage location preference into preferences rather than the wizard.
  Made LocalStore log less verbose Added @Override compile checks
  Added ACTION_SHUTDOWN broadcast receiver to properly initiate shutdown sequence (not yet implemented) and cancel any scheduled Intent
  Be more consistent about which SQLiteDatabase variable is used (from instance variable to argument variable) to make code more refactoring-friendly (class is already big, code extraction should be easier if not referencing the instance variable).
  Added transaction timing logging
  Factorised storage lock/transaction handling code for regular operations.
  Use DB transactions to batch modifications (makes code more robust / could improve performances)
  Merge mail-on-sd branch from trunk
  Update issue 888 Added DB close on unmount / DB open on mount
  Update issue 888 Back to account list when underlying storage not available/unmounting in MessageView / MessageList
  ...
2010-11-13 21:40:56 +00:00
cketti
5b88a99de0 Got rid of some compiler warnings. 2010-11-04 03:11:34 +00:00
Jesse Vincent
524dfb348a Updated MIME Type list with http://www.stdicon.com/mimetypes 2010-10-23 16:28:18 +00:00
Jesse Vincent
105df4c61a It turns out that not every android release has a good extension to
mimetype mapping. restore our previous hardcoded mime database as a
fallback
2010-10-23 16:28:07 +00:00
Jesse Vincent
6061c42ea9 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs 2010-10-05 06:04:28 +00:00
Jesse Vincent
524350a960 Replace our (incomplete) custom MIME type list with a call to webkit. 2010-10-05 06:03:24 +00:00
Jesse Vincent
e0447e32cc astyle 2010-08-29 16:57:13 +00:00
Marcus Wolschon
726b472330 set context before using it 2010-08-18 14:13:37 +00:00
Jesse Vincent
ff5024eaec astyle 2010-08-18 02:48:55 +00:00