Commit Graph

76 Commits

Author SHA1 Message Date
Jesse Vincent 20e47991c3 astyle 2010-07-11 15:39:26 +00:00
Jesse Vincent c359b2c6bf Comment out redundant logging of IMAP commands
Each IMAP command was logged 3 times in normal operation. It seriously
clouds the logs and makes it much harder to read and debug ongoing
connections
2010-07-11 12:31:47 +00:00
Jesse Vincent 7a543b45b1 Remove duplicate code between two message counting routines in ImapStore 2010-07-11 12:31:34 +00:00
Jesse Vincent 9321a045d9 When counting remote unseen/flagged messages, don't window to only the
most recent 300 messages - Since we display this # to the user, the
"last 300" heuristic ends up confusing and _wrong_ on a regular basis.
2010-07-11 12:31:22 +00:00
Jesse Vincent ae339f1ac8 Add a per-account setting to choose how much of each message to download automatically. 2010-07-11 11:59:14 +00:00
Jesse Vincent 4024cca2aa Add a comment about the custom IMAP command Yahoo! needs to work right. 2010-07-10 16:41:22 +00:00
Jesse Vincent a826f33eb3 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi
--mode=java --indent-switches --indent=spaces=4 --convert-tabs
--unpad=paren
2010-07-06 10:29:26 +00:00
Daniel Applebaum cdbcb188ec Fixes Issue 1664
Correct thread safety on some member variables when doing null checks.

Explicitly check for mMessageCount == -1 and stop=true in idling loop.

However, the original error message "Message count = -1 for folder"
will still arise in some circumstances and is a valid error to
report.
2010-07-03 15:22:54 +00:00
Daniel Applebaum 8cb7f8f317 Fixes Issue 1763
Patch from jca02266 to use locale independent date formatter.
2010-06-11 12:56:01 +00:00
Daniel Applebaum 6d6a9d0ffd Fixes Issue 1707
Eliminate extraneous spaces

Also, abort IMAP IDLE connection attempt if mConnection is null before
IDLEing.  Otherwise, we cannot set the idle timeout.
2010-06-02 14:25:04 +00:00
Daniel Applebaum b35f807820 Fixes Issue 227
Provide for controlling the maximum age of syncrhonized messages.
Efficient with IMAP, much less efficient with other Stores.
2010-05-30 21:20:47 +00:00
Daniel Applebaum dedfd026be Fixes Issue 254
Provide for only showing folders that are subscribed on the server
(IMAP only)

Also:
Change default for Notification behavior to the old way.  Make going
to the search for unread messages off by default.

Fix up some hiding of labels, etc. on the incoming server settings.

Check for message suppression in search results.
2010-05-30 16:56:50 +00:00
Jesse Vincent 1a66072910 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren 2010-05-30 04:17:00 +00:00
Daniel Applebaum 291f6d18a2 Fixes Issue 1643
Fixes Issue 1664

Issue 1643: Some servers respond with an untagged EXISTS to every
NOOP.  This change parses through all untagged responses in a loop
until no more are being generated, avoiding calling internalOpen each
time.

Issue 1664: I have never personally seen this error, and the log looks
like a thread safety problem.  mMessageCount is being set in one
thread (the IDLE thread) but not properly visible in another thread
(the check mail thread).  mMessageCount and other ImapFolder private
variables are now volatile in hopes of correcting this problem.
2010-05-26 03:24:33 +00:00
Daniel Applebaum 24b178773f Make sure prefix is fetched before any call to getCombinedPrefix. 2010-05-22 17:34:16 +00:00
Daniel Applebaum 6afb8c8506 Make sure to compare capabilities using upper case. 2010-05-20 11:55:42 +00:00
Daniel Applebaum 59f22d8e7e Save capabilities in upper case so we handle them case-insensitively,
too.  Make sure all CAPABILITY-detection constants are written in
upper case.
2010-05-20 04:19:15 +00:00
Daniel Applebaum d873ecbe7a From cketti's reminder: check untagged response with equalsIgnoreCase.
Also, reset mCombinedPrefix when the delimeter is discovered.
2010-05-20 04:13:49 +00:00
Daniel Applebaum af55c6f48b We don't need to log the content of the map each time we add to it. 2010-05-20 03:38:16 +00:00
Daniel Applebaum 44da2e1fe6 After discussion with cketti, reinstate using LIST to find the path
delimeter, but only if the server does not support NAMESPACE.  Since
we've encountered non-compliant servers that freak out at the LIST
command, enclose in a try/catch structure so that failures do not
totally prevent IMAP communication.
2010-05-20 02:33:44 +00:00
cketti 58b8479612 Code refactoring:
- Created "controller" and "mail.filter" package
- Moved a lot of classes to new/other packages
- Removed unused classes: NoSuchProviderException, MessageDateComparator
2010-05-19 18:17:06 +00:00
cketti 22ce159fe6 Merge imap-parser branch.
Fixes issue 1547.
2010-05-19 13:31:48 +00:00
Daniel Applebaum 9cf42ef913 Provide for tracking all WakeLock usage.
Simplify WakeLocks use by pushing.

Correct fault in IMAP IDLE WakeLock usage.  The ThreadLocal in
MessagingControllerPushReceiver meant that the WakeLock acquired when
the DONE was sent was not being released when entering back into IDLE
state.

Consolidate the account notification so that all Activities use the
methods in MessagingController.
2010-05-17 00:30:32 +00:00
Jesse Vincent ecebdf18cd find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren 2010-05-15 19:46:16 +00:00
Daniel Applebaum b51bce6ebf Fixes Issue 1551
Fixes Issue 1577

Issue 1551: 
Some IMAP servers send untagged EXPUNGEs to IDLEing
clients without ever haven't sent an untagged FETCH.  The untagged
EXPUNGEs are harder to deal with because they don't have a UID.  So,
if the user has elected to have the IDLE connection start with a poll,
we can maintain a map of message sequence numbers to UIDs that we can
use to figure out which message to delete.  To mitigate the risk of
the map falling out of date, we do a UID SEARCH UID before removing
the local copy of the message, just to make sure the message is really
gone from the server.  If we detect an error, do another poll to
resync the map.

Issue 1577:
Restore the removal of notifications for an account when the account's
unread message count goes to 0.
2010-05-15 19:35:07 +00:00
Jesse Vincent ba021597c4 astyle 2010-05-12 02:51:59 +00:00
Daniel Applebaum 6aeac22dad Fixes Issue 300
Fixes Issue 772
Fixes Issue 852

Issue 300: Handle incoming IMAP tokens in a case-insensitive manner

Issue 772: Add Yahoo workaround

Issue 852: Add configurable IMAP IDLE refresh frequency in Incoming
server settings

Also:
Add configuration option for whether push system executes a poll on
each connect.

Move the configuration for the maximum number of push folders to the
Incoming server Settings.
2010-05-09 15:27:41 +00:00
Jesse Vincent c31b224de3 enable dan's new "resync accounts on reconnect" code for push 2010-05-03 00:20:27 +00:00
Jesse Vincent 8af7f4a7b6 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren 2010-04-29 04:59:14 +00:00
Daniel Applebaum 0459be3bb8 Fixes Issue 868
When connected to a server that does not automatically send an
untagged UIDNEXT with the responses to SELECT, explicitly SEARCH for
the currently highest UID in the folder on the server and then add 1
to it to get the UIDNEXT.
2010-04-27 04:06:26 +00:00
Daniel Applebaum 78a101547c Provide for doing a full poll/sync of a folder whenever the IMAP IDLE
connection is established.  Turned off for now, but just get rid of
the false && on line 2641 in order to enable it.
2010-04-27 03:02:17 +00:00
Jesse Vincent 55d70c3bf7 rather than fetching 10 messages on push reconnect, fetch a full
compelment of displayable messages. This should help eliminate "Gaps"
when reconnecting push connections after going offline.
2010-04-26 16:20:43 +00:00
Daniel Applebaum 41c5dc5986 Fixes Issue 1448
Fixes ClassCastException.

Also:
Envelope and star in Accounts Activity are now both "hot".  Tapping
the main part of the search opens the full search; tapping the
envelope opens the search only for unread messages; tapping the star
opens the search but only for starred messages.

The envelope and star are a bit small to reliably tap.  Both options
should be available via long-press, also.

Methodology will be extended to real accounts, as well.
2010-04-22 02:20:35 +00:00
Daniel Applebaum 664c4d6a78 Fixes Issue 1394
Computing the account size is pretty slow for big accounts, and making
this functionality optional should be considered.

Also, displays the number of flagged messages ("stars") in each
account in the Accounts list and each folder in the FolderList.  Needs
better presentation of the flagged message counts, but this works as a
proof-of-concept and gets the data structures built.
2010-04-16 14:33:54 +00:00
cketti 57cc4cd735 Code cleanup. Fixed lots of warnings reported by Eclipse.
- Removed unused imports
- Removed unused variables/code
- Parametrized raw types
- Added @Override annotations
- Added hashCode() when equals() was overriden
2010-04-16 12:20:10 +00:00
Daniel Applebaum 86f3b28f79 Fixes Issue 1413
Look for + as acknowledgement that we're in IDLE mode, not "idling"
string.  

Also, to help with battery life:
1) Give up trying to IDLE after 10 failures.
2) Increase retry delays
2010-04-15 03:17:25 +00:00
Daniel Applebaum d08c9d6ce2 Fixes Issue 957
Fixes Issue 868

May not be perfect, either, but may help in some situations with
getting all emails to arrive via push.
2010-04-06 02:39:57 +00:00
cketti 938317e700 Get rid of the "Did not get proper search result" message. This helps with buggy IMAP servers that don't return an untagged SEARCH response if nothing was found. Other untagged responses are simply ignored.
Fixes Issue 907
2010-03-25 01:24:21 +00:00
Daniel Applebaum ecc10e572f Fixes Issue 1224
Implement DEFLATE compression for IMAP communication, enabled by
default.  User can disable compression for Wi-Fi, Mobile, or Other
networks, if it causes problems or if uncompressed communication is
faster, which is possible on Wi-Fi and wired networks, especially.

"Other" is to allow for the Android platform to introduce new
networking types without having to immediately change K-9 Mail.
However, as those arise, new network types should be added as explicit
types in K-9 Mail.
2010-03-07 00:30:40 +00:00
Daniel Applebaum c0e4220b82 Fixes Issue 1116
Fixes Issue 1278
Fixes Issue 119
Fixes Issue 1077
Fixes Issue 1238

Worked performed by danapple0 and cketti in
https://k9mail.googlecode.com/svn/k9mail/branches/issue1116

Add support for most batch ops (except move and copy) in search
results.  Add support for batch move and copy on real folders.

Increase efficiency of bulk IMAP moves and copies by doing as multiple
UID operations.

Eliminated serialization of Account objects.

Provide up-references in useful places to make all future code cleaner
and more efficient.

Fixed a bunch of draft handling

Merged from issue1116 branch, except for Account.java, which was
copied wholesale.  Account.java was manually merged in issue1116
branch at r1489

svn merge -r 1459:1489 https://k9mail.googlecode.com/svn/k9mail/branches/issue1116 .
cp ../issue1116/src/com/fsck/k9/Account.java src/com/fsck/k9/Account.java
2010-03-04 04:00:30 +00:00
Daniel Applebaum 97c7bf1d65 Hopeful (but untested code) to get updated capabilities after
successful CRAM-MD5 authentication.
2010-02-27 17:48:00 +00:00
Daniel Applebaum f6e7d5d4c0 Fixes Issue 1252
Handle CAPABILITY response in following cases:
1) When sent as part of the banner, no longer sends explicit
CAPABILITY command

2) When sent as an UNTAGGED response to LOGIN, updates stored
   capabilities.

3) When sent as part of the TAGGED response to LOGIN, updates stored
   capabilities.

Due to odd implementation of the CRAM-MD5 authentication, the
capability updates will not happen as part of the CRAM-MD5
authentication.
2010-02-27 17:34:38 +00:00
cketti ec3d9eb9ea Removed code from ImapStore.internalOpen() that tried to get the path delimeter before SELECTing a mailbox. This shouldn't be a problem since the delimeter
a) is already known if the server supports the NAMESPACE capability.
b) is included in the prefix anyway (=also known if namespace was set manually).
c) isn't needed when selecting a mailbox because we currently don't support folder hierarchy. So the delimeter is included in the folder name.

Fixes issue 1217
2010-02-20 01:07:38 +00:00
cketti 51b92aaf80 Fixes issue 1225 2010-02-14 15:51:09 +00:00
Daniel Applebaum 2c3da067c3 Fixes Issue 1219
At cketti's suggestion, change the methodology for counting
server-side unread messages on an IMAP server from STATUS (UNSEEN) to
SEARCH UNSEEN NOT DELETED.  STATUS (UNSEEN) does not ignore DELETED
but unexpunged messages and leads to incorrect results.

http://www.mail-archive.com/c-client@u.washington.edu/msg00929.html
http://www.mail-archive.com/c-client@u.washington.edu/msg00931.html

This variant only checks for unread messages in the last 300 messages
in the folder, so will be wrong if there are unread messages earlier
in the folder.  However, it'll be more often correct than the old
version for the marjority of users.

Also, change the opening of folders for IMAP IDLE purposes to
read-only using EXAMINE instead of SELECT.
2010-02-13 17:02:27 +00:00
cketti 2bd4f9632b Better handling of IMAP FETCH responses.
Fixes issue 1068
2010-02-10 13:52:25 +00:00
cketti 8049e90b8c Changed IMAP command "UID SEARCH (HEADER MESSAGE-ID %s)" to "UID SEARCH HEADER MESSAGE-ID %s"
Fixes issue 1031.
2010-02-03 17:25:15 +00:00
Jesse Vincent a58095aae1 URLEncode username and password for accounts, so as to not fall apart on
nice simple characters like ':' in passwords.

Patch by cketti

Fixes Issue 1155.
2010-02-02 02:06:29 +00:00
Jesse Vincent 4493044340 astyle pass 2010-01-18 00:11:02 +00:00
Jesse Vincent 591a3af6dc Eliminate "select" mode in favor of a unified swipe and context menu -based
always-available select action.  For the moment, this means
that widgets_on_left does nothing at all. based on feedback, I may kill
the preference and multi-mode behaviour entirely in favor of "show stars?"
(and possibly "show stars on left"

Stars, "checkboxes" and color bars updated to actually fit in wide mode.
2010-01-17 04:20:39 +00:00