Commit graph

416 commits

Author SHA1 Message Date
cketti
b4ef2fb15b IMAP: Use MOVE command if available 2023-11-20 17:39:46 +01:00
cketti
8b66b04692 IMAP move operation should ignore expunge policy
Because the original IMAP specification doesn't include a move operation, we implement it as copy, followed by deleting the source message. Deleting messages in IMAP is a two stage process. First a message is marked as deleted, then the EXPUNGE command is issued. However, the EXPUNGE command will remove all messages in a folder marked as deleted. For a move operation, we don't want to remove other messages, and therefore won't issue the EXPUNGE command. However, if the server supports the UIDPLUS extension, we can specify which messages exactly should be expunged. So if that extension is available, we will use the UID EXPUNGE command on the source message of a move operation.

Since the EXPUNGE command removes all messages marked as deleted, K-9 Mail has a setting that controls when the command is issued (when deleting a message, when polling, manually via a menu option). Previously this setting was also used for move operations. However, that probably should have never been the case.
2023-11-18 18:09:08 +01:00
cketti
1de41d9177 Add FolderFetcher 2023-11-10 22:24:15 +01:00
Wolf-Martell Montwé
7565bb8e66
Fix max-line-length issues manually as auto format does fail 2023-11-07 10:40:08 +01:00
cketti
77ff16bcf7 IMAP: Add app version to ID command 2023-11-02 17:56:55 -04:00
Wolf-Martell Montwé
1236d7114c
Change repository links from thundernest/k-9 to thunderbird/thunderbird-android 2023-11-02 14:35:06 +01:00
Wolf-Martell Montwé
b970e2f90f
Enable AlsoCouldBeApply rule 2023-10-10 13:34:45 +02:00
Wolf-Martell Montwé
e9535ecdaa
Bump Spotless 6.14.0 -> 6.21.0 and KtLint 0.48.2 -> 0.50.0, and reformat/fix code 2023-09-06 18:13:23 +02:00
cketti
4efbf3d0d9 Add OAuth to auto discovery flow 2023-07-31 15:16:09 +02:00
cketti
8e7a5f3541 Add an AuthStateStorage parameter to ServerSettingsValidator
Typically we use `Account` to hold the (OAuth 2.0) authorization state. But during account setup we don't have an `Account` instance yet. So we allow a `ServerSettingsValidator` caller to pass an `AuthStateStorage` that we then use with `OAuth2TokenProviderFactory` to create an `OAuth2TokenProvider` instance. When setting up an account we can use an `AuthStateStorage` implementation that will simply hold the state in memory.
2023-07-29 23:36:02 +02:00
cketti
84f132c148 Add abstraction for storing and retrieving the OAuth state 2023-07-26 15:28:34 +02:00
Wolf-Martell Montwé
ea8c0beb5c
Add server config validation use cases and change check interface to SAM 2023-06-27 11:33:46 +02:00
cketti
ed49b34412
Merge pull request #7024 from thundernest/check_imap_server_settings
Add `ImapServerSettingsValidator`
2023-06-26 13:39:37 +02:00
cketti
2706107519 Add ImapServerSettingsValidator 2023-06-23 17:20:06 +02:00
cketti
1e42e92b1b Include more information in IMAP-specific ServerSettings
The additional properties are necessary to validate server settings.
2023-06-23 17:13:22 +02:00
cketti
8143ae53ec Add responseText property to NegativeImapResponseException 2023-06-23 14:11:30 +02:00
cketti
3abe666bd3 Convert NegativeImapResponseException to Kotlin 2023-06-23 14:11:30 +02:00
cketti
289eadd575 Rename .java to .kt 2023-06-23 14:11:30 +02:00
cketti
04d0c762a9 Add Pop3ServerSettingsValidator 2023-06-23 13:36:25 +02:00
cketti
f404dabf08
Merge pull request #7017 from thundernest/refactor_pop3_exception_handling
Change exception handling in POP3 code
2023-06-23 13:35:30 +02:00
cketti
f2d096c6e3 Change exception handling in POP3 code
Defer wrapping an IOException in a MessagingException for as long as possible.
2023-06-22 14:36:11 +02:00
cketti
0bdb03d50c Add SmtpServerSettingsValidator 2023-06-22 13:22:11 +02:00
cketti
d99067a9a7 Add ServerSettingsValidator interface 2023-06-21 19:41:35 +02:00
cketti
a574c39be0 Create better AuthenticationFailedException instances
Provide a value for `messageFromServer` whenever possible. We're showing this to the user when checking server settings has failed, so they get a better idea of what went wrong.
2023-06-21 18:31:52 +02:00
cketti
774d95d4f5
Merge pull request #7008 from thundernest/consistent_reply_behavior
Fetch `List-Post` header when downloading partial message
2023-06-20 16:42:14 +02:00
cketti
ff31f79dc2 Fetch List-Post header when downloading partial message 2023-06-20 15:04:43 +02:00
cketti
07985f7066 Use IOUtils.skipFully() in FixedLengthInputStream
There was a bug in the `skip()` implementation of `PeekableInputStream` which have could lead to an endless loop in `skipRemaining()`. Using `IOUtils.skipFully()` should avoid such a problem in the future.
2023-06-17 17:21:48 +02:00
cketti
7b7ffe4b88 Fix PeekableInputStream to adhere to the InputStream contract 2023-06-17 17:21:48 +02:00
cketti
fde82fe7b4 Convert PeekableInputStream to Kotlin 2023-06-17 17:21:45 +02:00
cketti
ff9bec87e1 Rename .java to .kt 2023-06-17 13:13:34 +02:00
cketti
cde85b97a2 Add tests for PeekableInputStream 2023-06-17 13:13:34 +02:00
cketti
3bf19ca3f6 Add UserInputEmailAddressParser
Used to parse name and email address pairs entered by the user when composing a message.
2023-06-07 18:40:49 +02:00
cketti
2dbecb667c Move HostNameUtils to :core:common 2023-05-22 18:03:56 +02:00
cketti
ef498c60e4 Update assertk to version 0.26 2023-05-16 17:20:25 +02:00
cketti
8376909043
Merge pull request #6897 from thundernest/rewrite_to_assertk
Switch assertions to assertk
2023-05-16 16:27:13 +02:00
cketti
5498567bf2 Switch assertions to assertk 2023-05-14 13:00:28 +02:00
cketti
a266e0a6fc Convert FixedLengthInputStream to Kotlin 2023-05-13 23:10:16 +02:00
cketti
64050584b5 Rename .java to .kt 2023-05-13 23:10:16 +02:00
cketti
9c4a0d40be Convert FixedLengthInputStreamTest to Kotlin 2023-05-13 22:55:54 +02:00
cketti
1e629952bc Rename .java to .kt 2023-05-13 22:52:15 +02:00
cketti
ec7c282ffd
Merge pull request #6883 from thundernest/hostname_validation
Add `HostNameUtils` to check the validity of host names and IP addresses
2023-05-10 18:45:30 +02:00
cketti
182e2c217c Fix escaping commas in buildOAuthBearerInitialClientResponse() 2023-05-08 15:46:04 +02:00
cketti
21be092394 Add HostNameUtils to check the validity of host names and IP addresses 2023-05-08 12:58:51 +02:00
cketti
626a9c318c
Merge pull request #6877 from thundernest/secure_random
Switch from `Random` to `SecureRandom`
2023-05-05 17:55:37 +02:00
cketti
79078344c2 Switch from using Random to SecureRandom 2023-05-05 16:35:30 +02:00
cketti
ff188cdfb5 Remove WebDAV code 2023-05-04 22:14:00 +02:00
cketti
07d2a42a4d Add tests for sending the IMAP ID command 2023-04-26 14:58:44 +02:00
Self Not Found
f2ce1fe344 IMAP: Add support for sending ID command with app name 2023-04-26 14:58:44 +02:00
Wolf Montwé
71079908aa
Bump Gradle 8.0.2 -> 8.1.1 and remove suppress dsl scope violation 2023-04-25 17:21:58 +02:00
cketti
4695bd0460 Don't parse Content-Transfer-Encoding as header containing named parameters 2023-04-20 18:57:57 +02:00