Commit Graph

116 Commits

Author SHA1 Message Date
Bao-Long Nguyen-Trong 23797b62ee . Fixed issue 423:
. HTMLized version of plain text email is not loaded up as a MIME part of the message anymore. We use a custom seperate variable in the text body class.
2009-05-20 04:36:20 +00:00
Bao-Long Nguyen-Trong 435e2c3532 Fixed issue 404:
. Free up memory as we go in MessagingController.synchronizeMailboxSynchronous()
  . IMAP: We only do a partial fetch of the text body of large messages during background sync. This allow for faster syncs and avoid expensive parsing that lead to OutOfMemoryError
2009-05-20 04:27:51 +00:00
Bao-Long Nguyen-Trong 42194562c1 Minor optimization to avoid the OutOfMemoryError we have been getting 2009-05-17 05:59:28 +00:00
Bao-Long Nguyen-Trong bb8629abe8 . Potential fix for issue 404: now doing all HTMLization in one pass to minimize the amount of String objects 2009-05-10 07:05:24 +00:00
Bao-Long Nguyen-Trong 5b0dee8cc0 . Large messages are now only retrieved once for POP3 servers that don't support the TOP command 2009-05-10 05:47:26 +00:00
Daniel Applebaum 97a4f97b64 Issue 234
Fix POP3 deletes.  Verizon uses - in their POP3 UIDs, and K9 was
assuming that only Local UIDs have -.  Removed that assumption.  Also,
after issuing DELE on POP3 connection, need to also issue a QUIT.  The
delete code in MessagingController now closes the folder after
deleting a message, which will slow down IMAP deletes, but also
conserve connections, so is probably a net benefit.
2009-05-09 15:22:36 +00:00
Jesse Vincent 718e27dab9 WebDavStore updates to fix authentication issues - based on design and counselling from ismarc31 2009-05-07 03:17:26 +00:00
Daniel Applebaum 96c98e3070 Reformat executeSimpleCommand 2009-05-06 00:16:47 +00:00
Daniel Applebaum 27e0ec1b80 Decrement mMessageCount when an untagged EXPUNGE is received 2009-05-06 00:12:30 +00:00
Daniel Applebaum aac64b03a5 Make sure not to lose an untagged EXISTS, even if it came during a
command that we didn't handle properly.
2009-05-05 04:03:56 +00:00
Daniel Applebaum 651642faeb Automatically re-synchronize the IMAP protocol. Previously, losses of
synchronization could happen if an Exception was thrown while parsing
an untagged response without using executeSimpleCommand.  For
instance, while doing a fetch.  Once synchronization was lost, later
commands would fail in surprising ways.  One manifestation of such
failures was spontaneously emptying of folders when search results
were not returned properly.  The new code makes sure to only accept OK
responses with the tag of the command, and discards the untagged
responses from previous command.
2009-05-05 00:42:05 +00:00
Jesse Vincent 7daf4ef1e6 We don't actually want to clear out the plaintext version of the message. K-9 uses that for replies 2009-05-05 00:29:15 +00:00
Jesse Vincent 323c294250 Move our linkification and htmlification of mesages from on-display to on-sync.
There's no need to defer this work until the user is waiting for it
2009-05-03 20:52:32 +00:00
Jesse Vincent 4b444b2bcf don't try to recreate the indexes on every db update as it will surely fail 2009-05-03 04:22:34 +00:00
Jesse Vincent ab82b10918 Add a few indexes to the message and folder lists 2009-05-02 22:14:45 +00:00
Daniel Applebaum d1661ee1f5 Reset mMessageCount before executing SELECT. Only handle untagged
responses to SELECT once.
2009-04-21 05:34:57 +00:00
Daniel Applebaum f0f07c36de Issue 63
Issue 201
Issue 224
Issue 342

Handle untagged EXISTS messages at any time.  Should increase
synchronization speed and accuracy.

Handle IMAP servers that send a NIL where a literal is normally.
Avoids failure to sync when folder contains certain messages.

Throw Exception if folder message count is less than 0, avoiding
accidentally emptying a folder.
2009-04-21 04:22:02 +00:00
Daniel Applebaum 4ad4216de5 Fix problems connecting to POP3 servers which lack the CAPA command. 2009-04-15 13:05:29 +00:00
Daniel Applebaum aa4a92a541 Application of patch submitted by cnehren for Issue 356, with
generalization.
2009-04-11 15:24:22 +00:00
Daniel Applebaum 932adf5ed2 Issue 143
Merged from branch issue143 @ revision 426:

Complete replacement for SharedPreferences.  Uses SQLite database
stored in application's databases folder.

Will load from legacy preferences if DB-backed preferences are empty.

Editor conforms to atomic commit contract.
2009-04-11 14:33:54 +00:00
Daniel Applebaum 5711abdee5 Issue 234 Issue 366 Issue 329
Hardening of POP3 and SMTP communication:

SMTP: Decrement failure counter when no possible message send
occurred.  This way, K-9 will only stop attempting to send messages
for which a possible successful send occurred, but K-9 could not
detect.  Any message that is known to have completely failed to send
will be reattempted indefinitely.

POP3: Some reworking of Exception handling.  Also, if it is not
possible to get a "message number" for the UID of the message that is
being deleted, conclude that the message has already been deleted on
the server.  Mark this as a permanent error, so that it gets removed
from the pending actions queue.

MessagingController: Look for the permanentFailure flag on the
MessagingException, and if a pending action raised a permanent
failure, remove the pending action from the queue so that it will not
be re-attempted nor block later requests.
2009-04-11 02:11:17 +00:00
Matthew Brace 1b5fdb99d9 Fix for authentication issue describe in issue 359. 2009-04-02 01:52:00 +00:00
Daniel Applebaum 45227e2708 Delete now uses LocalFolder.moveMessages
Copy now copied body (but attachments might not work right).

Move is now reliable (needed to open the destination folder), and
leaves a placeHolder message behind in the source folder so that
messages are not resynced.
2009-03-07 07:20:15 +00:00
Daniel Applebaum 15e5cb4eaf Provides the ability to move and copy messages between folders. Issue
3.

Each remote Store (IMAP, POP3, WebDAV) can provide indications to the
higher level classes as to whether copy and move are implemented.
Currently, copy and move are only provided by ImapStore.java.  When
the facilities are not available, the user interface suppresses the
menu options.

The available destination folders can be configured using folder
classes.

Copy results in null message bodies in the destination copy of the
message until the next sync.  This is a problem that occurred with
deletes previously, and is likely a fault with the copyMessages method
of LocalStore.java.

Utilizes a modified version of the ChooseFolder.java Activity that
debuachedsloth contributed in a patch attached to Issue 285 on 16 Feb
2008.
2009-03-05 07:32:45 +00:00
Bao-Long Nguyen-Trong db426c44b7 . Applied patch from dumbfile which fixes issue 307 and issue 265 related to date format when running on a device with a non US locale 2009-03-04 19:49:39 +00:00
Daniel Applebaum 73d5e16178 Fix for problem with r386 found by kanisdragon. 2009-03-02 00:47:27 +00:00
Matthew Brace 91573e19ac Fix for null pointer exception when there is an exception thrown and the caught in processRequest without properly terminating checks (ie, during the recursive calls, resulting in a null data set being returned). 2009-02-26 06:56:30 +00:00
Daniel Applebaum 6f8a243bcc Issue 318
When performing a database upgrade, clear all cached attachments and
attachment thumbnails
2009-02-25 03:35:25 +00:00
Daniel Applebaum 2d31b4e52d Issue 179 and Issue 320
Puts quotes around username and password for IMAP authentication.

Also, if authentication fails, closes the connection so that it will
be retried.  Otherwise, there is no way to fix the problem, say, by
changing the password in the Incoming Settings.
2009-02-25 01:50:20 +00:00
Daniel Applebaum 0e9d1f195e Issue 319
Do not reset all folder settings when a database upgrade occurs. (Or
any other event that wipes all of the local folders.
2009-02-24 05:03:28 +00:00
Matthew Brace acea3ab3b5 Pull destination url from OWA login page. Order of priority for destination is: User specified mailbox path, destination form value on OWA login page, "/" character. 2009-02-19 04:35:15 +00:00
Bradley Young 61aba8fa78 Changed host from static to instance. Should help to prevent conflicts with multiple accounts. 2009-02-11 21:07:25 +00:00
Daniel Applebaum 3e4843e756 Issue 131
Provide two options for each Account:
Compact (which VACUUMs the accounts and prunes recreatable
attachments)

Clear all data (danger!) (which wipes all messages and attachments in
the account, except placeholder deleted messages)

Displays a Toast when the Compact or Clear is queued, and another
Toast with the shrinkage results.

(Also, a small change to increase probability of seeing messages after
a sync, by setting the needsRefresh on all folders when a sync is done.)
2009-02-10 03:18:42 +00:00
Matthew Brace 8c466c35ba Add proper handling for relative paths from initial login page for WebDav. Provides support for Exchange 2007. 2009-02-09 06:48:57 +00:00
Matthew Brace da46773f74 Fix potential index issues when less than 10 emails are in the folder when fetching messages in WebDavStore. 2009-02-09 01:50:31 +00:00
Daniel Applebaum 98ff7af644 Just can't believe the prior code was right. Possible fix for Issue 234. 2009-02-06 20:11:36 +00:00
Matthew Brace f184350aec Fix for index out of bounds exception (regression) from r330 2009-01-31 22:09:16 +00:00
Matthew Brace 0a6bc9bdd4 Changed authentication method. Added support for authentication if the server returns a 401 status code. No longer requires form based authentication. 2009-01-27 05:39:41 +00:00
Matthew Brace de24b6a166 Added support for optional Form Based Authentication login path and user mailbox path in account settings. 2009-01-25 07:37:10 +00:00
Daniel Applebaum 7d5d473563 Fix for Issue 238
Only fixes display of attachment filenames for newly downloaded
messages.  Will not correct display for message already in the
LocalStore.
2009-01-24 19:35:57 +00:00
Daniel Applebaum b6e9910e00 Needed for r326 Issue 91 2009-01-24 18:54:47 +00:00
Matthew Brace 483857ed74 A missed hardcoded value. This should resolve most 400 Bad Request issues. It is unknown if this affects the Invalid Verb responses. 2009-01-22 03:53:09 +00:00
Matthew Brace 1cda221fa3 Added support for Exchange path. This is not specifying the path for authentication or for the mailbox. This is support for situations like "https://www.myserver.com/owapath" for authentication. 2009-01-21 05:27:22 +00:00
Matthew Brace b50a782c1c New DataSet data model for XML parses from HTTP responses. Much less memory used for a negligible hit in processor usage. Some additional whitespace cleanup. 2009-01-18 02:43:15 +00:00
Daniel Applebaum 172adeee22 Add ability to Flag/Unflag messages. Flagged messages are shown with
a red/bold subject.  Can be done in the FolderMessageList using the
hotkey G (toggle) or by long-pressing the message to bring up the
message context menu.  Can be done while viewing an individual message
by using the hotkey G (toggle).  To-do: add a Flag/Unflag option to a
menu in the individual message view.

Add sending the Answered flag to the IMAP server when replying to a
message.  This is currently done as soon as the reply is started.
Perhaps it would be better to wait until the reply is sent, but that
would require keeping additional state with the draft.  Messages to
which the user has replied are indicated with a white arrow next to
the subject.

To-do: In the MessageView, provide visual indication of Flagged and
Answered states.
2009-01-13 05:52:37 +00:00
Daniel Applebaum 1f9bf1ec50 Issues 199 & 201
No fixes, just extra details in thrown Exceptions to try to track down
problems.
2009-01-09 05:42:59 +00:00
Daniel Applebaum d0a354ead0 Delete needs to know how to use Imap prefix 2009-01-09 05:01:05 +00:00
Matthew Brace 7d5d29e078 Added support for non-Exchange 2003 standard login paths (web scraping for login URL).
Added support for default mailbox path setting if we can't automatically determine what it is.
Fixed a bug exposed by changes relating to a fix for non-relative email paths being returned.
2009-01-08 05:47:10 +00:00
Daniel Applebaum 1bc879c30c Eliminate assumption that item 1 will be a String 2009-01-07 06:37:44 +00:00
Daniel Applebaum 3a3dc2da43 Instant deletes from FolderMessageList. Faster deletes from
MessageView

Deleting a message in Trash deletes it for real (permanently)

All message operations are allowed on messages in the Outbox.  Special
handling for deleting, so that the message is copied to Trash, then
copied asynchronously to the remote Trash.

Add some more items to the hotkey help
2009-01-07 06:02:04 +00:00
Bradley Young 2e4ee5b59f Fix for sending mail; additional logging when there is an invalid (non-http-2xx) response. 2009-01-06 01:31:57 +00:00
Bradley Young 8221094570 self-signed cert support for WebDav. 2009-01-05 00:05:43 +00:00
Bradley Young 73006c65a3 Disabling self-signed certs for webdav (not IMAP); they are currently causing issues. 2009-01-03 10:15:56 +00:00
Daniel Applebaum 828ceba503 Set to use new folder display and sync class defaults.
Accounts are now set:
Folder display mode = All except 2nd Class
Folder sync mode = Only 1st Class

Only the Inbox is set for:
Folder sync class = 1st Class
All other folders have class set to None for sync and display

Also restored an optimization on opening local folders that I
removed.  It is now optimistic, and in the normal case does not have
to make an explicit existence check
2009-01-03 01:47:24 +00:00
Bradley Young 51b6a03f8c Added self-signed/mismatched domain handling for HTTP over SSL connections in WebDav. 2009-01-01 08:56:19 +00:00
Daniel Applebaum 4cc1ea489a Restored automatic creation of a local folder on open. Why was this
removed in K9?  I can't find the history of LocalStore.java to find
the answer.  Eliminated now redundant creation of Outbox and Drafts
folders.
2008-12-31 16:05:03 +00:00
Daniel Applebaum 334d64141f Complete merge of DAmail functionality into K9mail. Following
features are added to K9mail:

1) Show unread message count on each folder
2) Sum unread count of all shown folders in an account to the account display
3) Periodically check selected folders for new mail, not just Inbox
4) Don't refresh folder when opened (unless folder is empty)
5) Show date and time of last sync for each folder
6) Fix timer for automatic periodic sync (use wakelock to assure completion)
7) Optimize local folder queries (speeds up account and folder lists)
8) Show Loading... message in status bar indicating which folder is being synced
9) Eliminate redundant sync of new messages (performance enhancement)
10) Improve notification text for multiple accounts
11) Do not automatically sync folders more often than the account-specific period
12) Use user-configured date and time formats
13) Select which folders are shown, using configurable Classes
14) Select which folders are synced, using configurable Classes
15) Added context (long press) menu to folders, to provide for Refresh
and Folder Settings
16) Status light flashes purple when there are unread messages
17) Folder list more quickly eliminates display of deleted and out-of-Class folders.
18) Delete works 
19) Mark all messages as read (in the folder context menu)
20) Notifications only for new unread messages
21) One minute synchronization frequency
22) Deleting an unread message decrements unread counter
23) Notifications work for POP3 accounts
24) Message deletes work for POP3 accounts
25) Explicit errors show in folder list
26) Stack traces saved to folder K9mail-errors
27) Clear pending actions (danger, for emergencies only!)
28) Delete policy in Account settings
29) DNS cache in InetAddress disabled
30) Trapped some crash-causing error conditions
31) Eliminate duplicate copies to Sent folder
32) Prevent crashes due to message listener concurrency
33) Empty Trash
34) Nuclear "Mark all messages as read" (marks all messages as read in
server-side folder, irrespective of which messages have been downloaded)
35) Forward (alternate) to allow forwarding email through other programs
36) Accept text/plain Intents to allow other programs to send email through K9mail
37) Displays Outbox sending status
38) Manual retry of outbox sending when "Refresh"ing Outbox
39) Folder error status is persisted
40) Ability to log to arbitrary file

Fixes K9 issues 11, 23, 24, 65, 69, 71, 79, 81, 82, 83, 87, 101, 104,
107, 120, 148, 154
2008-12-31 03:49:09 +00:00
Matthew Brace 72c4095ceb Finished initial refactoring of fetch(). Some slight formatting and cleanup changes as well. 2008-12-29 00:25:19 +00:00
Matthew Brace 34be0269f8 Added stubs for the added functions needed for the DAMail merge. Did not add @Override. Doing it this way to allow easier testing/modifications in preparation for the merge to trunk. All trunk changes will be committed to the DAMail merge branch next. 2008-12-26 06:52:07 +00:00
Matthew Brace 2dede98463 Refactored how the HTTP calls were to reduce the growing volume of duplicated code. 2008-12-26 06:47:00 +00:00
Matthew Brace 409acd0134 Added support for proper deletions in WebDAV. Deleting a message the first time moves it to the (currently hardcoded) Deleted Items. Deleting an item in 'Deleted Items' will remove it completely. 2008-12-25 08:38:55 +00:00
Matthew Brace 46d4619ffb Fix for date/time issues prior to fetch(BODY) or fetch(BODY_SANE) is called. 2008-12-25 01:08:34 +00:00
Matthew Brace dc7a1a0532 Fixed an issue where some Exchange servers wouldn't mark messages as read. Fixed incorrect URL encoding in some folder path names. Removed some unneccessary headers from the envelope request. 2008-12-24 03:09:37 +00:00
Matthew Brace 18c51bae5c Removed unneeded header fields from WebDav requests. Fix for some instances of subfolders not working. 2008-12-22 22:14:02 +00:00
Jesse Vincent 28e8827827 Even more progressive rename/unfork work 2008-12-16 23:34:01 +00:00
Jesse Vincent ac55d3034b oops 2008-12-16 23:09:23 +00:00