Commit Graph

2821 Commits

Author SHA1 Message Date
cketti 4ece2bb428 Add missing import 2014-06-21 01:47:24 +02:00
cketti 3b17aa0496 Fix potential ClassCastException
Implemented the fix suggested by zjw in pull request #463
https://github.com/k9mail/k-9/pull/463

Fixes issue 5928
2014-06-20 22:38:05 +02:00
cketti 19b180a3b6 Avoid NullPointerException reported via Google Play 2014-06-20 22:37:43 +02:00
cketti 0c37a28754 Exclude error folder from unread/starred count 2014-06-20 22:37:22 +02:00
Dominik Heidler dcd1e63812 Fix sendCommand line splitup for some imap proxys
When sending a command it would be sent like this:
PKG1: 1 STARTTLS
PKG2: \r\n

Some imap proxys (maybe from Fortinet?) don't accept commands across packets:
PKG1: 1 STARTTLS\r\n
2014-06-20 22:36:47 +02:00
cketti ca16f36db9 Avoid adding the same recipient twice when using "reply to all"
Fixes issue 6056
2014-06-20 22:36:30 +02:00
cketti e8f7f6ef38 Fix 'endless' loop in ImapFolderPusher
Under certain circumstances it's possible that the 'push state' isn't
updated to contain the most recent 'UIDNEXT' value. In that case
ImapFolderPusher.start() would execute the same code path through its
main loop over and over again, preventing the device from going to
sleep.
Rather than changing the code to update the 'push state' in the corner
case that triggers the behavior described above, this commit introduces
another mechanism to track the 'UIDNEXT' value. This should also catch
as of yet unknown cases where the 'push state' isn't properly updated.

At some point in the future I hope we get to a point where we only
persist the 'push state' when we manually stop/restart the service.
During normal operation there's no need to read from/write to storage
all the time.

Fixes issue 4907
2014-06-20 22:36:13 +02:00
Koji Arai 25c3c635fc Should disable COMPOSE menu item
When message viewing and tap the next icon, menu icons (previous, next, delete and replys) disappears for an instant.
But a compose icon remains, then tap it accidentally.
2014-06-20 22:36:08 +02:00
cketti 5d130b2de1 Don't crash when startActivity() fails
Fixes issue 6201
2014-06-20 22:36:01 +02:00
Troy Rollo aef6321ecd Alternative fix for issue 5697 - ASUS display bug 2014-06-20 22:35:58 +02:00
cketti 5437dc39e1 Support extras for ACTION_VIEW + mailto: URI
Support the extras documented for ACTION_SEND to be used with
ACTION_VIEW to support another app that doesn't care, namely Twitter.
2014-06-20 22:35:55 +02:00
cketti 0910e0bedb Restore instance state in correct order
Fixes issue 5968
2014-06-20 22:35:53 +02:00
cketti 06f31dd872 Disable pull-to-refresh when remote search is not allowed
Fixed issue 6151
2014-06-20 22:35:49 +02:00
cketti 85317af6ff Fix issue 6064: Inline images don't display on KitKat
Backported Joe's fix.
See commit 094156cc2a
2014-01-27 15:56:17 +01:00
cketti 0582432166 Merge pull request #437 from zjw/misc_clean_up 2014-01-14 05:46:01 +01:00
Joe Steele d1fc587772 Fix POP3 STLS command
The server response needed to be retrieved.

Thanks to Paul Durrant:
https://groups.google.com/d/msg/k-9-mail/0XHNNMR1TQ4/yExsr7nvJQwJ
2014-01-14 05:46:01 +01:00
Joe Steele b392603ae0 Use a locale-specific date in the header of a quoted message
Also, include the sent-date in the header when using
the "prefix" quote style.  "Be like mutt" (and gmail,
and thunderbird)

Also, the quoteOriginalHtmlMessage method was using the mSourceMessage
field in various places when it should be using its originalMessage
parameter.

Related issues:  2249, 3456
2014-01-14 05:46:01 +01:00
Joe Steele d6b6bf6254 Account preferences clean-up
There were a number of preferences that were not being removed
from the preferences DB when an account was deleted, so they
would remain there forever.

There were a few attempts to remove preference keys from the DB where
the keys were obsolete and not in use for some time.

Certain obsolete preferences were not modified:
mUuid + ".name"
mUuid + ".email"
mUuid + ".signature"
mUuid + ".signatureUse"
These were in use before implementing multiple identities, and are still used
as a fallback for old accounts without multiple identities configured.
2014-01-14 05:46:01 +01:00
cketti dc0c567007 Revert "Add work-around for Asus Transformer WebView display bug"
This reverts commit 78428e287b.
2014-01-14 05:46:00 +01:00
cketti 6c9d84b9fa Rename plurals to make Transifex happy 2014-01-14 05:45:58 +01:00
cketti 2e398c8f79 Fix ClassCastException 2014-01-14 05:45:56 +01:00
cketti cfaa36403c Revert "Make IMAP autoconfig recognize "Draft" as drafts folder"
This reverts commit df0f6f3a8e.
See https://github.com/k9mail/k-9/pull/429
2013-12-17 18:47:38 +01:00
erlendorf df0f6f3a8e Make IMAP autoconfig recognize "Draft" as drafts folder
Yahoo names it "Draft" instead of the more common "Drafts".
2013-12-17 02:37:41 +01:00
Jasper Klein c1bcdf5dbe Add work-around for Asus Transformer WebView display bug 2013-12-17 02:37:41 +01:00
cketti 624a16b900 Ignore all errors in initialization of TrustedSocketFactory
On Android 2.2 getEnabledProtocols() throws an
ArrayIndexOutOfBoundsException
2013-12-17 02:37:39 +01:00
cketti 2fac2d6e0e Return proper error message when certificate couldn't be verified against global key store 2013-12-17 02:37:39 +01:00
cketti e54cba22fd Add support for bitcoin URIs 2013-12-17 02:37:38 +01:00
Joe Steele 927950b16c Change LocalKeyStore error reporting
The error reporting assures an exception is thrown if
setKeyStoreFile(null) is called without a prior call to
setKeyStoreLocation(String directory).

Also, fix TrustManagerFactoryTest indentation.
2013-12-17 02:37:38 +01:00
cketti f7f6a0e9f3 Change the way we harden SSL/TLS sockets
Blacklist a couple of weak ciphers, bring known ones in a defined order and sort unknown
ciphers at the end. Also re-enable SSLv3 because it's still used a lot.
2013-12-17 02:37:38 +01:00
Joe Steele 8099aff8e7 Eliminate the need to pass a context to LocalKeyStore.getInstance
Instead, have K9.onCreate initialize the location of the key
store file (similar to what is done with
BinaryTempFileBody.setTempDirectory).

Also, LocalKeyStore.getInstance has been changed so that it
no longer needs to be synchronized.
2013-12-17 02:37:37 +01:00
Joe Steele 255bf1fb36 Don't delete certs. on account creation, & assure that only one instance of LocalKeyStore is created. 2013-12-17 02:37:37 +01:00
cketti 8d85fe7e9e Remove LocalKeyStore's dependency on K9.app 2013-12-17 02:37:37 +01:00
cketti 16aa119d65 Remove LocalKeyStore's dependency on Account to reduce coupling 2013-12-17 02:37:37 +01:00
Joe Steele 7296b67126 "upgrade" the LocalKeyStore
Implement an "upgrade" capability for the key store file,
and then use it to delete the old file.

The existing certs in the old file are not a security
risk, but they are now useless because the format of
their aliases was changed in commit a4440b4.  They now are
just taking up storage space and memory.

Users will need to re-accept *ALL* certificates that they had
previously accepted and are still using.  (Actually, this requirement
was effective with commit 4b57d79a.  Before that, certificates whose
Subject matched did not require re-accepting.)
2013-12-17 02:35:27 +01:00
Joe Steele 7a9663c4f9 Implement pruning of old certificates from LocalKeyStore
Certificates are deleted whenever server settings are changed
or an account is deleted.
2013-12-17 02:35:27 +01:00
Joe Steele fd9eb78aa3 Move some classes out of com.fsck.k9.mail.store
The classes are just as much related to com.fsck.k9.mail.transport
as com.fsck.k9.mail.store, so having them in
com.fsck.k9.mail.store doesn't seem appropriate.

Move LocalKeyStore to com.fsck.k9.security

Move TrustManagerFactory and TrustedSocketFactory to com.fsck.k9.net.ssl
2013-12-17 02:35:26 +01:00
Joe Steele a2162e4c37 Extract code into new LocalKeyStore class
Also, implement the ability to configure an alternate key store
file location. This permits the running of unit tests without
clobbering the live key store file.

Also, add a test to confirm that the key store file is being written
out and reread correctly.
2013-12-17 02:35:26 +01:00
cketti 0c96c799eb Only check against the certificate stored for a server, not all of them 2013-12-17 02:35:26 +01:00
cketti 9cc98bcd33 Add unit tests for TrustManagerFactory 2013-12-17 02:35:26 +01:00
cketti 5282fe482f Properly save and restore instance state in AccountSetupBasics 2013-12-17 02:35:26 +01:00
Joe Steele 583d1d403f Fix inadequate certificate validation
Proper host name validation was not being performed for certificates
kept in the local keystore.  If an attacker could convince a user to
accept and store an attacker's certificate, then that certificate
could be used for MITM attacks, giving the attacker access to all
connections to all servers in all accounts in K-9.

This commit changes how the certificates are stored.  Previously, an
entire certificate chain was stored for a server (and any of those
certificates in the chain were available for validating signatures on
certificates received when connecting).  Now just the single
certificate for the server is stored.

This commit changes how locally stored certificates are retrieved.
They can only be retrieved using the host:port that the user
configured for the server.

This also fixes issue 1326.  Users can now use different certificates
for different servers on the same host (listening to different ports).

The above changes mean that users might have to re-accept certificates
that they had previously accepted and are still using (but only if the
certificate's Subject doesn't match the host that they are connecting
to).

This commit modifies AccountSetupBasics so that it now calls
AccountSetupCheckSettings twice -- once for checking the incoming
settings and once for the outgoing settings.  Otherwise, an exception
could occur while checking incoming settings, the user could say
continue (or the user could accept a certificate key), and the
outgoing settings would not be checked.  This also helps with
determining if a certificate exception was for the incoming or
outgoing server, which is needed if the user decides to add the
certificate to the keystore.
2013-12-17 02:35:25 +01:00
Danny Baumann f95ab8f6a8 Fix contact picture color generation.
Make sure to return different colors for senders with different name,
but the same mail address (e.g. mails sent by certain issue tracking
systems).
2013-12-17 02:35:25 +01:00
brian m. carlson 266a715138 Use TrustedSocketFactory for STARTTLS.
The TrustedSocketFactory, which provides goodies like better cipher suites and
TLSv1.2, was only being used for tunnelled connections.  Use it for STARTTLS
connections as well.
2013-12-16 18:59:37 +01:00
Jesse Vincent be14a88103 With the new webview scrollview combo we've got loadinoverviewmode seems to behave better. 2013-11-07 10:40:01 -08:00
cketti ed3a160403 Fix file selection for import
Using FLAG_ACTIVITY_NO_HISTORY will cause the file selection
to fail when KitKat's "Open from" activity opens a third-party activity.
2013-11-07 09:31:21 -08:00
Jesse Vincent bc10b8d965 turn off developer mode for release 2013-11-05 20:55:44 -05:00
Jesse Vincent e20e513039 Sadly, KitKat's file manager fails to recognize our mimetype and won't let users import settings 2013-11-05 20:19:27 -05:00
Joe Steele 1cbdd390f3 Use non-deprecated constants 2013-11-05 16:26:29 -05:00
Joe Steele 5311a2ef01 NonLockingScrollview fixes.
Implement methods missing in API 7

Fix coordinate reference frame mismatch.  Touch events are
relative to the view display, whereas view children are relative
to the view.
2013-11-05 16:26:28 -05:00
Joe Steele fa962e7bd7 Move AOSP files.
Patch RigidWebView for K9.
MessageWebView would need to extend RigidWebView.
2013-11-05 16:26:27 -05:00