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

689 Commits

Author SHA1 Message Date
cketti
987b8b17b1 Merge pull request #21 from k9mail/reconstruct_original_message_in_memory
Reconstruct original message in memory
2014-12-11 22:00:57 +01:00
cketti
d1d7b60a09 Add helper method to decode message bodies
Depending on whether a Body implements RawDataBody (which indicates the class
retains the original encoding) the helper method either strips the transfer
encoding or simply returns the result of Body.getInputStream().

This should restore the original functionality. So saving messages in the
database should work fine again.
2014-12-08 16:32:23 +01:00
cketti
9f4f0cf6a8 Modify BinaryTempFileBody to retain the encoded body
For now this breaks a lot of things, e.g. saving messages to the database
and making messages 7-bit safe.
2014-12-08 16:32:23 +01:00
cketti
d32d6eed0e Move "magic" from Part.setBody() implementations to MimeMessageHelper.setBody()
Now adding message bodies during parsing won't set/modify headers.
2014-12-08 16:32:23 +01:00
cketti
bcb6c75c2e Add support for storing raw header fields 2014-12-08 16:32:23 +01:00
Danny Baumann
aaf3963567 Don't throw CertificateValidationException for all SSLExceptions.
An interrupted connection attempt to the server yields an SSLException
as well, like this:

E/k9      ( 6937): Caused by: javax.net.ssl.SSLHandshakeException: Connection closed by peer
E/k9      ( 6937):      at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
E/k9      ( 6937):      at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:302)
E/k9      ( 6937):      at com.android.org.conscrypt.OpenSSLSocketImpl.waitForHandshake(OpenSSLSocketImpl.java:598)
E/k9      ( 6937):      at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:560)
E/k9      ( 6937):      at com.fsck.k9.mail.store.ImapStore$ImapConnection.open(ImapStore.java:2459)

We don't want the user to notify of 'certificate problems' in that case.
Fix it by checking whether the SSLException was actually triggered by a
CertificateException.
2014-12-04 13:16:33 +01:00
cketti
98b5d63909 Merge branch 'open_attachment_improvements'
Conflicts:
	src/com/fsck/k9/helper/Utility.java
2014-11-27 21:03:15 +01:00
cketti
7211080415 Merge pull request #10 from k9mail/art/more-tidying-arrays
Replace many arrays with collections
2014-11-11 19:45:35 +01:00
cketti
34cfd8e5b4 Extract file related helper functions into separate class 2014-11-11 01:04:39 +01:00
Art O Cathain
438a350f55 remove unnecessary method parameters 2014-10-19 18:40:17 +01:00
Art O Cathain
40102d560d Set interface makes more sense for flags 2014-10-05 12:40:35 +01:00
Art O Cathain
195f28db00 Revert accidental change 2014-10-05 12:23:43 +01:00
Art O Cathain
444756839c EnumSet is more efficient than HashSet 2014-10-05 12:08:55 +01:00
Art O Cathain
159017e91d removed unneeded variables and clarified names 2014-10-05 11:50:04 +01:00
Art O Cathain
d38f21265d use isEmpty instead of size() == 0 for clarify 2014-10-05 10:37:50 +01:00
Art O Cathain
02c0b5f2a3 Use collections instead of arrays to enable stronger typing and reduce cruft 2014-10-05 10:37:36 +01:00
Art O Cathain
203dcfe2c3 use interfaces, not implementions 2014-10-04 12:00:48 +01:00
tobiasbaum
dadf5e0865 Merge pull request #7 from artbristol/art/tidying
Art/tidying
2014-09-29 22:15:59 +02:00
Art O Cathain
010d8c9f7e always use import for UrlEncodingHelper 2014-09-29 18:06:21 +01:00
Art O Cathain
2226ae6a8e fix IDE error 2014-09-28 12:48:46 +01:00
Art O Cathain
c438bc1222 remove some more catches 2014-09-28 12:09:34 +01:00
Art O Cathain
afb65d5ad7 remove some try-catch cruft 2014-09-28 11:39:32 +01:00
Art O Cathain
46d083bcad fix warnings 2014-09-28 11:19:33 +01:00
Tobias Baum
2be10febf9 Added (still rather shallow) missing Javadocs for classes in BinaryAttachmentBody hierarchy 2014-09-22 21:55:08 +02:00
Tobias Baum
b6079d6460 UCDetector warnings: Made things private, deleted unused methods and fields 2014-09-22 21:52:59 +02:00
Tobias Baum
7d32b3d462 Removed unnecessary overriding methods 2014-09-14 11:17:02 +02:00
Tobias Baum
a9aa4645af Removed unused methods 2014-09-14 11:15:44 +02:00
Tobias Baum
5513d5a99b Pulled down getSize from Part to Message which makes ImapBodyPart superfluous 2014-09-14 11:11:48 +02:00
cketti
601e2880ac Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/com/fsck/k9/mail/transport/SmtpTransport.java
2014-09-12 07:11:32 +02:00
Christian Frommeyer
9dba60c997 Some minor code cleanings and logging for LockableDatabase 2014-09-11 20:26:40 +02:00
Christian Frommeyer
eced036d69 Extracting Database Setup Schema definition form LocalStore. 2014-09-11 20:26:40 +02:00
Christian Frommeyer
91ef5fa816 Extracted LocalFolder and LocalMessage definition from LocalStore 2014-09-11 20:26:40 +02:00
Christian Frommeyer
89ba2c510b More nested classes extracted from LocalStore. 2014-09-11 20:26:40 +02:00
Christian Frommeyer
f92da3af59 Extracting local attachment classes from LocalStore to reduce file size. 2014-09-11 20:26:39 +02:00
Christian Frommeyer
038fceabf0 Move LocalStore to new subpackage to prepare decomposition of nested
classes.
2014-09-11 20:26:39 +02:00
Joe Steele
6f14294164 Remove SslHelper. Don't use SecureRandom.
SslHelper has been removed, and its functionality has been transferred
into TrustedSocketFactory.  The added layer of indirection wasn't really
simplifying anything.  It's now easier to see what happens when
createSocket() is invoked.

A new instance of SecureRandom is no longer passed to SSLContext.init().
Instead, null is passed.

The (default) provider of the TLS SSLContext used is OpenSSLProvider,
which provides an SSLSocket instance of type OpenSSLSocketImpl.  The only
use of SecureRandom is in OpenSSLSocketImpl.startHandshake(), where it is
used to seed the OpenSSL PRNG with additional random data.  But if
SecureRandom is null, then /dev/urandom is used for seeding instead.

Meanwhile, the default provider for the SecureRandom service is
OpenSSLRandom, which uses the OpenSSL PRNG as its data source.  So we were
effectively seeding the OpenSSL PRNG with itself.  That's probably okay
(we trust that the OpenSSL PRNG was properly initialized with random data
before first use), but using /dev/urandom would seem like a better source
(or at least as good a source) for the additional seed data added with
each new connection.

Note that our PRNGFixes class replaces the default SecureRandom service
with one whose data source is /dev/urandom for certain vulnerable API
levels anyway.  (It also makes sure that the OpenSSL PRNG is properly
seeded before first use for certain vulnerable API levels.)
2014-09-06 18:15:25 -04:00
cketti
5f0f4e9c21 Merge pull request #485 from haselwarter
Conflicts:
	src/com/fsck/k9/preferences/Settings.java
2014-09-04 23:55:30 +02:00
cketti
5802e6a36a Remove getNotifyClass() from Folder 2014-09-04 23:54:06 +02:00
cketti
7edd1cb53c Simplify database upgrade when adding 'notify_class' to 'folders' 2014-09-04 23:54:06 +02:00
cketti
bd9efa8d01 Whitespace fixes 2014-09-04 22:58:38 +02:00
Joe Steele
f7fb0cca41 Compare Enum types with ==, !=
Per comments in PR #473

https://github.com/k9mail/k-9/pull/474#commitcomment-7416979

https://github.com/k9mail/k-9/pull/474#commitcomment-7416999
2014-08-18 18:12:39 -04:00
Joe Steele
301ac48a38 Throw CertificateValidationException if EXTERNAL authentication fails
This is done when the SASL EXTERNAL mechanism isn't advertised (indicating
the possibility that the server did not accept the client certificate) or
when the command for authenticating with SASL EXTERNAL fails.

The CertificateValidationException will trigger a notification to the user
that there's an authentication problem that needs addressing.

Also, there were instances where CertificateValidationException was being
thrown with a new CertificateException as the cause for the purpose of
notifying the user when STARTTLS is not available.  This has been slightly
simplified by eliminating the need to include a new CertificateException
as a cause.
2014-08-11 11:07:54 -04:00
Joe Steele
c0be0eea12 Use the correct POP3 AUTH command 2014-08-11 11:07:51 -04:00
Joe Steele
88016ae52e Revert unused code changes 2014-08-11 11:07:37 -04:00
Philipp Haselwarter
7aa4c1308e Configure mail notifications by folder class
In response to Issue 1794,
- add a configuration option in the account preferences to show
  notifications only for 1st/2nd/etc class folders
- add an option in the folder preferences to set the notification class
  as 1st, 2nd or inherited from the folder's push class

The default behaviour remains unchanged.
2014-08-06 11:04:07 +02:00
Dominik Schürmann
aad171ff7e Client Certificate Authentication 2014-06-05 21:03:18 +02:00
cketti
5c93f105ea Avoid NullPointerException reported via Google Play 2014-03-23 00:39:10 +01:00
Joe Steele
95f62785fc Eliminate unused field/parameter 2014-03-20 09:47:43 -04:00
Joe Steele
01d2247ffd Change POP3 error response detection
Instead of interpreting a "-" at the beginning of a line as
an error response, consider the absence of a "+" at the
beginning of a line as an error response.

This is what Thunderbird does.

http://hg.mozilla.org/releases/comm-esr24/file/55e96a433bd1/mailnews/local/src/nsPop3Protocol.cpp#l1177

The problem arises with godaddy servers spewing additional
lines of data upon login failure.  The login was being
interpreted as successful, and a STAT commanded was subsequently
being sent, resulting in a dialog saying 'Cannot connect to
server. (Invalid int: "auth_error:")'.

$ openssl s_client -quiet -crlf -connect pop.secureserver.net:995
...
+OK <24984.1394317012@pop.secureserver.net>
user testuser
+OK
pass testpass
testuser not found in the auth database
warning: auth_error: authorization failed (no such object)
-ERR authorization failed  Check your server settings.
2014-03-11 19:10:14 -04:00
Joe Steele
e475e51731 Rework handling of certificate errors while pushing
Eliminate import of MessagingController in ImapStore.
2014-03-11 19:08:09 -04:00