Commit graph

457 commits

Author SHA1 Message Date
cketti
6b28c5b41b Don't allow user to supply content of type message/*
Instead we rewrite the MIME type to application/octet-stream. This is
so we don't create broken messages in case the user-supplied content is
not a valid message.
In the future we could add some validation code and allow the user to
attach well-formed messages using the proper MIME type.
2018-01-08 16:41:31 +01:00
cketti
0cf4b8aaa5
Merge pull request #2910 from jyn514/unused-vars
Removed unused variables
2017-12-30 03:30:14 +01:00
cketti
d50319053a
Merge pull request #2986 from philipwhiuk/testBodyStructure
Add test for IMAP FETCH BODYSTRUCTURE
2017-12-29 06:01:37 +01:00
Joshua Nelson
a2ad2dd10b Removed unthrown exceptions from method signatures (#2913)
For OAuth2TokenProvider.getToken(), changed exception thrown to
match method signature (AssertionError -> AuthenticationFailedException)
2017-12-27 12:28:27 +00:00
Philip Whitehouse
fae5017832 Add test for IMAP FETCH BODYSTRUCTURE 2017-12-24 18:52:37 +00:00
cketti
c2eb00b4f6 Do nothing in ImapConnection.close() if connection is not open
Under certain circumstances ImapFolderPusher can call
ImapConnection.close() twice. When using compression this will
lead to a NullPointerException inside ZOutputStream.close(). We're
ignoring all exceptions when closing a connection. So this shouldn't be
a problem. But (early versions of?) Android 8.1 shipped with a bug in
ART that shuts down the VM when a NullPointerException is triggered from
AOT/JIT(?) compiled code that uses a certain optimization. And we're
unlucky enough to trigger this bug.
Not closing the streams more than once should work around this bug.

See issue #2931
2017-12-20 07:07:35 +01:00
cketti
d6090c626b
Merge pull request #2725 from k9mail/improveDecoderUtil
Handle RFC2047 non-compliant splitting of characters
2017-11-12 18:36:02 +01:00
Hari
31b7cf8dae Rewrite IMAP expunge 2017-11-11 21:38:08 +05:30
Joshua Nelson
aa4fb26f8f Address now logs an error if given bad arguments (#2897) 2017-11-10 18:09:25 +01:00
Joshua Nelson
3fdb5f532f Simplified logic (#2911) 2017-11-10 18:05:57 +01:00
cketti
97b4c06632 Remove FolderSelectedStateCommand 2017-11-09 08:51:56 +01:00
cketti
590b6c6cc0 Combine responses in ImapConnection.executeSelectedStateCommand() 2017-11-09 08:51:56 +01:00
Hari
aa7e00263f IMAP refactoring 2017-11-09 08:51:56 +01:00
cketti
4248e4172a
Merge pull request #2908 from jyn514/casting
Remove unneccessary casting and unboxing
2017-11-07 16:16:42 +01:00
Joshua Nelson
77acb11dd6
Removed unused variables 2017-11-03 19:57:29 -04:00
Joshua Nelson
9db6cdc1c2
Remove unneccessary casting and unboxing
Removed casts to (View)
Removed calls to <Integer>.getInt(), <Long>.getLong()
Changed a few for loops to for-each loops
2017-11-03 18:45:47 -04:00
Joshua Nelson
a6388ca84f
Remove unused imports 2017-11-03 18:25:28 -04:00
Joshua Nelson
ddcf1e257e Fixed issue 2846
Skip invalid input; parse strictly otherwise.
See [issue](https://github.com/k9mail/k-9/issues/2846) for details.
2017-10-29 21:11:16 -04:00
cketti
cdf92c0a10 Fix decoding of encoded words 2017-10-14 07:39:10 +02:00
cketti
2de1c02c83 Add missing tests to DecoderUtilTest
Some tests fail showing bugs in the current implementation.
2017-10-14 07:38:50 +02:00
cketti
37d2c3609b Modify tests for text wrongly split into encoded words
We were using test data submitted by users. But we don't really know
what the expected result should be. In the second test the expected text
ended in a replacement character. That indicates the text is not decoded
correctly. Maybe there was an additional encoded word that was missing.
2017-10-14 06:01:05 +02:00
cketti
5f6b1dffc6 Refactor DecoderUtilTest 2017-10-14 05:41:33 +02:00
cketti
e266547bfc Merge pull request #2763 from k9mail/improve-crypto-structure-detection
Improve crypto structure detection
2017-09-16 23:36:48 +02:00
Philip
6b8e452f77 Improve the message we get when we reach the end of stream (#2769) 2017-09-14 15:02:56 +02:00
Vincent Breitmoser
2902657e5b Extract content only from the signed part of multipart/signed messages 2017-09-13 14:21:24 +02:00
Vincent Breitmoser
93348c21ce More rigid detection of multipart/signed and /encrypted structures 2017-09-13 11:51:36 +02:00
Philip
377ac71677 Upgrade MIME4J to latest release (#2744)
Upgrade MIME4J to latest release
2017-09-11 03:26:48 +02:00
cketti
24aacd47a1 Merge pull request #2739 from k9mail/add_kotlin_for_tests
Add Kotlin for tests
2017-09-11 01:34:19 +02:00
cketti
22e0649f6e Add Kotlin for tests 2017-09-07 05:00:21 +02:00
Philip Whitehouse
498df5db73 Add RFC2047 tests and fix a resulting whitespace bug 2017-09-02 11:19:25 +01:00
Philip Whitehouse
0e9e4daa80 Fix decoding with mix of decoded and encoded 2017-09-02 11:19:25 +01:00
Philip Whitehouse
f88c3594fc Add support for RFC 2047 non-compliant splitting of UTF-8 encoded characters 2017-09-02 11:19:25 +01:00
Philip Whitehouse
79582f12e4 Correct test name 2017-09-02 11:19:25 +01:00
Philip Whitehouse
1471e7a063 Split DecoderUtil tests up 2017-09-02 11:19:25 +01:00
Vincent Breitmoser
f88537284f simplify MAIL FROM formatting logic 2017-09-01 15:40:08 +02:00
Philip Whitehouse
e529542bba Post merge clean up 2017-09-01 13:31:21 +02:00
Philip Whitehouse
589b70bb09 Add test for server rejecting recipient but OK to empty message 2017-09-01 13:31:21 +02:00
yesalam
346bdc8cd2 Not sending message if any recipients recieve negative reply. 2017-09-01 13:31:21 +02:00
yesalam
f322cbe971 added if(lastcommand) in catch block 2017-09-01 13:31:21 +02:00
yesalam
65b66a05fd Added more test and removed some unused line 2017-09-01 13:31:04 +02:00
yesalam
8a552d46a0 SMTP pipelining support 2017-09-01 13:31:03 +02:00
Vincent Breitmoser
42bd8683dd autocrypt operations class 2017-08-31 13:19:25 +02:00
Vincent Breitmoser
4d580d539d add tests for MessageCryptoHelper 2017-08-30 22:39:59 +01:00
Philip Whitehouse
8b1cfb0730 Some more decoder tests - see #2499 2017-08-30 22:37:13 +01:00
cketti
cfd5d8a301 Merge pull request #2695 from k9mail/cleanup-smtp-transport
Cleanup smtp transport
2017-08-23 22:56:31 +02:00
Vincent Breitmoser
9cb7712142 clean up SmtpTransport 2017-08-23 02:12:40 +02:00
Vincent Breitmoser
c4f68b873a move transport uri encoding into its own class 2017-08-23 01:08:31 +02:00
Vincent Breitmoser
2fbd6f61a8 rename LocalMessage id field to databaseId 2017-08-22 16:49:58 +02:00
Vincent Breitmoser
6423742ca3 Merge pull request #2676 from philipwhiuk/testExecuteSimpleCommandStandardBehaviour
Test basic behaviour of executeSimpleCommand
2017-08-21 16:20:08 +02:00
Philip Whitehouse
9c6dc51f72 Test basic behaviour of executeSimpleCommand 2017-08-14 22:59:11 +01:00