1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00
Commit Graph

83 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
d1d9f1ea19 Merge remote-tracking branch 'upstream/master'
Conflicts:
	build.gradle
	gradle/wrapper/gradle-wrapper.properties
	plugins/openpgp-api-library/build.gradle
2014-12-09 00:57:27 +01:00
cketti
3919c9d2d6 Save multi part epilogue in MimeMultipart 2014-12-08 16:48:18 +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
f7d3eaa006 Fix setUsing7bitTransport() functionality for BinaryTempFileBody 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
51a60b5ad3 Modify ReconstructMessageTest to highlight more problems 2014-12-08 16:32:23 +01:00
cketti
2404b80b04 Fix MessageTest now that we preserve line breaks in headers 2014-12-08 16:32:23 +01:00
cketti
8630bb0ad4 Add simple test to check if writing a parsed message leads to input data 2014-12-08 16:32:23 +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
Art O Cathain
854b1b3ffc Add end-to-end tests using Espresso 2014-11-23 15:26:05 +00:00
Art O Cathain
552e552e88 Add unit tests for FileHelper.sanitizeFilename() 2014-11-18 23:50:14 +01:00
Art O Cathain
e592aff437 fix test that failed due to certificate expiry 2014-10-11 16:34:58 +01:00
Tobias Baum
960d7ba026 Renamed method according to review comment 2014-09-17 20:30:28 +02:00
Tobias Baum
be954d729c Whitespace, Tabs to Spaces 2014-09-14 11:18:57 +02:00
Tobias Baum
d467dca32c Added testcases for parsing and removed unused methods for parsing 2014-09-14 11:05:55 +02:00
Joe Steele
cf718780f6 Fixes needed after merging in master
Also, fix unit tests.
2014-07-04 19:23:43 -04:00
Joe Steele
5162d847ad Build plugins and tests with SDK 19 2014-03-11 19:10:25 -04:00
cketti
617123c58b Remove SimpleX509TrustManager because it's no longer used 2014-03-05 06:03:06 +01:00
Joe Steele
dc9720ca13 Use localized strings for authentication type
AUTOMATIC = "Automatic"
PLAIN = "Normal password"
CRAM_MD5 = "Encrypted password"

SMTP also uses LOGIN.  No localized text was associated with that because
a future commit will remove that option.

(The text is similar to that of Thunderbird's)
2014-02-25 15:22:35 -05:00
cketti
f89544ea8b Add failing test for HtmlConverter.linkifyText()
There's currently a bug in linkifyText() that can lead to a
StringIndexOutOfBoundsException when the text contains a
bitcoin URI and a "web" URI near the end of the text.
2014-02-17 18:33:33 +01:00
cketti
8e422f1183 Switch to a certificate that can be verified on the Cloudbees emulator 2013-12-06 06:53:57 +01:00
Joe Steele
dab8d3807f 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-04 12:10:12 -05:00
Joe Steele
cedcd7e47c 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-03 19:24:37 -05:00
cketti
765b390eb5 Remove LocalKeyStore's dependency on K9.app 2013-12-03 13:28:48 +01:00
Joe Steele
5bf27c1031 Move unit test class to match changes in commit 40404c3 2013-12-02 16:50:57 -05:00
Joe Steele
9e6abf5fa7 Merge branch 'cert_validation' of git://github.com/k9mail/k-9.git into cert_validation
Conflicts:
	tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java
2013-12-02 16:30:11 -05:00
Joe Steele
40404c3700 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-02 14:07:57 -05:00
Joe Steele
76605f7d86 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-02 14:04:40 -05:00
cketti
5f38306a9a Add more unit tests for TrustManagerFactory 2013-12-02 16:42:33 +01:00
Joe Steele
eb13691918 Eliminate the need for reflection to access hidden API 2013-11-30 18:34:57 -05:00
cketti
8368ba8a11 Add test to make sure we don't check the wrong certificates
Right now we happily accept every certificate in our local key store as long as
the hostname matches the certificate DN. So this test fails.
It's not a huge deal since the user accepted the certificate at one point. But we
want to do this right.
2013-11-29 11:39:04 +01:00
cketti
c5c195d243 Add unit tests for TrustManagerFactory 2013-11-29 10:49:52 +01:00
Joe Steele
5a46575dc2 Generally replace \n with \r\n when part of a message
This builds upon the efforts started 2 commits back where \r\n is used for
all message text and \n is only used when the text is inside an
EolConvertingEditText widget.
2013-10-11 11:39:46 -04:00
Joe Steele
e20170c996 Update the tests project.
Target the same SDK version as in K-9 Mail.

Update the .classpath file as modified by the latest Eclipse ADT plugin.

Remove unused import.
2013-10-11 11:24:55 -04:00
Koji Arai
0be299fbd0 Avoid StringIndexOutOfBoundsException when the header is broken like "=?us-ascii?q?abc?= =?" 2013-09-20 13:15:57 +09:00
Koji Arai
1c7d7af975 newly added a test testDecodeEncodedWords() 2013-09-20 13:15:49 +09:00
Joe Steele
1ca1ef5c84 Content-type case-conversion changes.
Don't convert the content-type to lower case in
MimeMessage.getContentType.  The content-type may have optional parameters
that are case sensitive (boundary, name).

In removing the lower-case conversion from getContentType, a review was
made for inappropriate case-sensitive comparisons which use data obtained
with getContentType.  The only ones found were in isMimeType in both
Message and MimeBodyPart.

Case-sensitive instances of isMimeType were made case-insensitive.  Also,
isMimeType was moved from Message to MimeMessage for symmetry with
MimeBodyPart (MimeMessage & MimeBodyPart are similar and contain a good
bit of duplication such as this).

The unit test required fixing now that the case of the boundary text is
preserved.

References:

Commits 2c5186 and dc4002 added the toLowerCase to getContentType in
MimeMessage & MimeBodyPart (Issue 94).

Later, commit 50cd60 removed the toLowerCase addition from MimeBodyPart
(Issue 1289).
2013-09-03 19:54:18 -04:00
Joe Steele
63f68328ff Standardize line breaks within headers.
Fix the unit test to match.

All line endings in the unit test are now the same.

(Just for consistency.  Not a big deal, since such problems are fixed when
the messages are run through EOLConvertingOutputStream.)
2013-09-03 19:54:17 -04:00
Joe Steele
074159f442 Unit test for recursive 8bit -> 7bit message conversion 2013-09-03 19:54:16 -04:00
Joe Steele
c40dd196a6 Simplify Eclipse setup.
Create .project files for all the Ecplipse projects
so they will all have project names and can
all be brought into Ecplipse together with a single
'File -> Import -> Android ->
Existing Android Code Into Workspace'.

(Not bothering to remove the .project exclusion from
all .gitignore files.  Once the .project files are
checked in, they will no longer be ignored.)

Modify the top .project file so that Eclipse knows
k9mail's dependence on it plugins, and thus will
build everything in the correct order.

With the latest Android SDK Rev. 22, the top .classpath file
needs modification or else K9 will not run (see parent commit 53fcdd1).
But the initial import of k9mail into Eclipse works more cleanly if the
.classpath file doesn't exist on import, in which case Eclipse creates it
automatically.  So rather than modify the .classpath file, remove it
from git and leave it untracked.

(For an existing Eclipse project, this commit will remove the file from
the working directory.  A corrected version can be restored with:
git checkout 53fcdd1 .classpath
git rm --cached .classpath)

Add .classpath to the top .gitignore, now that no
.classpath files are being tracked (with one exception,
see below).

Create a tests/.classpath so that Java can find the k9mail
project in order to build the k9mail-tests project.
2013-05-31 18:00:45 -04:00
Koji Arai
4dcf50d127 Re-desined textToHtml() according to the state transition diagram. 2013-05-11 08:44:17 +09:00
Koji Arai
3c83f7354e Added more tests for preserve spaces 2013-05-09 23:07:58 +09:00
Koji Arai
ae681cb7fe Added test for preserve spaces at first of line 2013-05-09 22:11:05 +09:00
Koji Arai
ba33ef232e Wrap expected long strings 2013-05-09 22:10:37 +09:00
Joe Steele
c790fa73c1 Don't store the font-family preference with plain text messages.
Dynamically generate the CSS style for <pre> elements
for inclusion in the HTML <head> element when messages
are displayed.

This permits a user to change their font-family preference
for plain text messages and see the results immediately.

Obviously any old locally-stored messages that had their
font-family stored with them will continue to display using
that font-family, irrespective of the user's current
preference setting.
2013-03-01 18:48:46 -05:00
Joe Steele
c21ea14af1 Fix unit tests. 2013-03-01 14:34:31 -05:00
Danny Baumann
0fac8e999d Clean up date handling.
Remove home-grown date formatting, and replace it by usage of the
DateUtils class which is present since API level 3.
2013-02-11 15:19:15 +01:00
cketti
e66dd3d521 Fixed unit tests 2012-10-08 14:43:34 +02:00