Commit Graph

18 Commits

Author SHA1 Message Date
Marc Blank a8b683cf3f More work on Imap2
* Handle sending mail and moving to sent folder
* Implement picker for sent folder
* Upload sent items to server
* Add support for "automatic" sync window
* Move some files from Email -> emailcommon
* The added files are copied directly from Email (and can be
  removed if/when Imap2 is merged back with Email)

Change-Id: I3a6a3d224826e547748be2f1b567b6294ad5db89
2012-07-19 14:27:17 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Marc Blank 20bf1f632f Support IMAP search in UTF-8, in addition to US-ASCII
* The existing IMAP search code is well-known to be primitive and
  largely broken.  In particular, it fails with any non-ASCII
  character and with a variety of symbols (e.g. quotes, slashes,
  etc.)  Basically, it's an accident waiting to happen, returning
  empty data sets even when the query might reasonably be expected
  (or known) to return valid data.
* The current CL uses the IMAP literal string format to represent
  the query text; this string can be sent either in ascii or in
  UTF-8, and since it is sent as an octet (byte) count followed by
  8-bit data, it also solves any quoting issues that might come
  up.  So, we kill two birds with one stone.
* The bug in question was punted to a subsequent MR; however, I
  think it would be a mistake to ship the code without this
  CL, which has been tested against the three common IMAP servers
  that we aim to support.

Bug: 4690713
Change-Id: Iaa542bfc56737871f3cbc9c83f0e768415a7f2b6
2011-08-17 16:17:04 -07:00
Marc Blank 53dddf3c55 Fix loss of client updates in IMAP when no connectivity
Bug: 5014965
Change-Id: Id5c6696ea1add598f180e739398ab14f60e382a3
2011-07-14 11:04:05 -07:00
Marc Blank 50a092c3d6 Add IMAP support for the "replied" state in messages
* Handle replied in new messages and updates
* Code added for upsyncing replied state, but the CL for
  setting this state isn't yet submitted

Change-Id: I6f3ff56475d70f686f96ed6a84fae3468f42b1c8
2011-07-07 12:00:07 -07:00
Makoto Onuki 745b33b8ff Fix all NoSuchMethodErrors
Change-Id: I05adf2b99c819d6aa2d3b52c52a8c655d9307337
2011-07-01 12:44:27 -07:00
Marc Blank 244d306ebb Remove more useless code
* Strike another blow for sanity!

Change-Id: Id95b441f9577abda66f04113793d6b1c60500ebe
2011-06-29 14:07:25 -07:00
Marc Blank 2720a818d5 Don't cache ImapFolders
* ImapFolder is currently very unsafe for use by multiple threads,
  causing, among other things, the referenced bug
* Since ImapFolder is very lightweight, there's no particularly good
  reason to be caching them anyway
* Rename isOpenForTest to isOpen

Bug: 4972084
Change-Id: I2bf17b9cfc8549a222e991f3e59abfd00a4d3afd
2011-06-29 13:02:55 -07:00
Marc Blank 9a01353f14 New search implementation for IMAP in MessagingController
* Add protocolSearchInfo column to Message table; this can be used
  to store information related to search results.  For IMAP, we
  store the serverId of the mailbox that the message lives in on
  the server
* Add upgrade code for this column
* Change MessagingController to use the proper serverId for remote
  operations, depending on whether the Message is a search result
  or not
* Fix some smaller issues with earlier code

Change-Id: I0c7f1d89a4659b95701d02646c0e8426680e2f6a
2011-06-23 22:02:00 -07:00
Marc Blank 627bc6ed57 First implementation of IMAP search
* Broke up synchronizeMailboxGeneric into three pieces; it's still
  horrible, but this at least stops my eyes from bleeding
* Remove unused method/tests from Folder interface

Change-Id: Ib4d979536be657137cf70ca535cf429d707be41b
2011-06-16 20:26:52 -07:00
Todd Kennedy 518fc490b2 Fix bug where we fail to acknowledge an APPEND
After appending a message to a mailbox (i.e. like appending to the 'sent'
mailbox after composing a new message), we would try to determine if the
append was successful by searching for the message. Most servers return an
APPENDUID response with the message's new UID. However, on those that don't
support APPENDUID, we need to perform a SEARCH for the message id. On one
set of these servers, the search would fail if the query string was
surrounded by parenthesis. However, another set of servers will fail if the
query string is not surroudned by parenthesis. So, we now try both ways.

Change-Id: I5a82ad241fb927e28aa5d05376568d5eac266a95
2011-05-17 10:43:46 -07:00
Todd Kennedy 171c3f2273 Some more re-arrangement of code
No real code changes; just moving where code / constants live. Removed
one unused method of Store.

Change-Id: Ie7532381759a568cb23601e1071c8e199b6beb07
2011-05-16 14:47:49 -07:00
Todd Kennedy ebece4dbdc Make ImapConnect a top-level class
Split out ImapConnection to its own class. This allows us to update ImapStore
without worrying about links between it and the connection.

Also, added a bit more safety to the classes in terms of correctly freeing
resources. Whenever the connection is closed, it now releases all resources.
Additionally, if the connection is ever put back in the pool, any response
data is released.

Change-Id: Ie3bda40d677707a0d6655f57175e58dece539e19
2011-05-16 14:17:58 -07:00
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00
Makoto Onuki bfac9f2e8a Move some of the log constants from Email to Logging
Change-Id: If9f4e4e3adcdef897a0d6a4e153bb446a8b24fdd
2011-05-13 14:24:38 -07:00
Todd Kennedy e87ff6c3cb Opportunistic cleanup
not making any real code changes:
* removed deprecated, unused methods
* remove 'throws' clauses when that exception is never thrown
* renamed method Controller#moveMessage()-->moveMessages()

Change-Id: Ifd006f760f0c19283e94a11a45c71295c8da35f7
2011-04-27 12:01:04 -07:00
Todd Kennedy 22208771b7 Add hierarchical folders to IMAP
We now create folder hierarcies for IMAP. This also includes a nifty SQL
statement that will get your existing database into shape.

Change-Id: If07a0632e9b250cf0c33c3e16bfba5816beab94c
2011-04-25 15:11:38 -07:00
Todd Kennedy ba7652cda0 Make ImapFolder a top-level class
No code changes; just moving the class

Change-Id: I4e4544d99d52dde85b96c99ef45da3a96e7d3d48
2011-04-19 09:31:43 -07:00