Alexander Krotov
979d7c5625
Do not ignore database read errors in precheck_imf
...
If precheck_imf fails to check if message with the same rfc724_mid
already exists, the same message may be downloaded twice. Instead,
abort the whole operation and retry later.
2020-04-23 15:36:45 +03:00
Friedel Ziegelmayer
24f4cbbb27
refactor: replace failure
...
- failure is deprecated
- thiserror for deriving Error impl
- anyhow for highlevel error handling
2020-04-10 22:39:28 +02:00
Alexander Krotov
3163ef87c6
imap: display errors with {}, not {:?}
2020-04-01 23:27:15 +03:00
Alexander Krotov
33150615a1
Improve logging for server UID updates in precheck_imf()
...
Log all folders and UIDs and warn about UID changes without folder change.
2020-04-01 20:06:27 +03:00
Alexander Krotov
65fdfac866
Remove unused dest_uid argument from Imap.mv()
...
It was always set to 0 because we don't know the destination UID.
2020-04-01 20:06:27 +03:00
Alexander Krotov
efb7280e99
Do not schedule delayed DeleteMsgOnImap jobs
...
All IMAP deletion jobs are scheduled either immediately, or later by
job::add_imap_deletion_jobs().
2020-04-01 20:06:27 +03:00
Alexander Krotov
6db03356b5
Return AlreadyDone from Imap.delete_msg if message is gone
...
This way DeleteMsgOnImap will remove invalid server_uid from the database.
2020-04-01 20:06:27 +03:00
Alexander Krotov
8f7a456a39
Use 0 value for "delete_server_after" default.
...
Now 0 means "never delete", 1 means "delete at once" and other values
indicate the number of seconds after which them message should be
deleted from the server.
Configuration value interpretation is moved into
Context.get_config_delete_server_after() function.
2020-04-01 20:06:27 +03:00
Alexander Krotov
6d216af507
Delete BCC-self messages after "delete_server_after" time
2020-04-01 20:06:27 +03:00
Alexander Krotov
98bd64621a
Refactor Imap.delete_msg() error handling
...
Mutable UID reference is removed. Instead, ImapActionResult is
returned immediately.
If message has changed and UID does not correspond to expected
message, ImapActionResult::Failed is returned. Temprorary IMAP errors
result in ImapActionResult::RetryLater.
On the job side, ImapActionResult::RetryLater does not result in
immediate job retry anymore. Instead, job is retried with a backoff.
2020-04-01 20:06:27 +03:00
Alexander Krotov
d78ea882c8
Update mailparse to 0.12
2020-03-31 18:11:44 +02:00
B. Petersen
e09a0a548f
using first() instead of [0]
2020-03-25 18:10:02 +01:00
B. Petersen
ab8d75b192
remove now unused ImapConfig.imap_delimiter
2020-03-25 13:23:29 +01:00
B. Petersen
e135c969c9
figure out and use folder-delimiter provided by LIST command
2020-03-25 13:16:23 +01:00
B. Petersen
36e7090466
force folder-reconfigure on dc_configure()
2020-03-25 02:39:48 +01:00
B. Petersen
f28f177c6b
use constant for folders_configured cache
2020-03-24 19:18:18 +01:00
Alexander Krotov
4714fb6887
Reset server_folder and server_uid in Imap.empty_folder()
...
This way we avoid trying to delete already deleted messages in the future.
2020-03-09 01:21:12 +03:00
Alexander Krotov
3c342339a1
imap: use parse_message_id from mimeparser
2020-02-22 16:41:07 +01:00
Alexander Krotov
33463856c5
Use mailparse::msgidparse to parse Message-IDs
2020-02-22 16:41:07 +01:00
Alexander Krotov
6b6be3b03d
Fix some "`" code markup
2020-02-18 05:06:11 +03:00
Alexander Krotov
1fa9aa88a8
Search for Flag::Deleted and Flag::Seen with == instead of match
2020-02-17 10:50:34 +01:00
Alexander Krotov
08c77c2668
fetch_single_msg: use if let Some(...) instead of is_empty()
2020-02-17 10:50:34 +01:00
Alexander Krotov
793ebe1b0f
imap: move IdleHandle from session.rs to idle.rs
2020-02-17 10:50:34 +01:00
Alexander Krotov
4c42acc7e1
Factor src/imap/session.rs out of src/imap/client.rs
2020-02-17 10:50:34 +01:00
Alexander Krotov
4eb9660bfa
Move src/imap_client.rs into src/imap/client.rs
2020-02-17 10:50:34 +01:00
Alexander Krotov
772127d9d8
Remove outdated comment
...
delete_msg no longer returns an integer
2020-02-16 03:43:25 +03:00
Alexander Krotov
04bb6997a2
Remove unused imap::idle::Error::ImapError variant
2020-02-14 22:33:36 +01:00
Alexander Krotov
9008a65c14
Remove DC_IMAP_SEEN constant
...
Replace "flags" integer with a "seen" boolean.
2020-02-13 13:55:06 +01:00
Alexander Krotov
4e07e4c7f3
Fix a typo (bbc-self instead of bcc-self)
2020-02-12 23:15:04 +03:00
Alexander Krotov
beb91271de
Unlock session before calling add_flag_finalized
...
add_flag_finalized tries to lock session again and IMAP thread deadlocks
if session is not unlocked.
2020-02-12 11:38:18 +00:00
Alexander Krotov
7e9585ebc5
cargo fmt
2020-02-12 11:38:18 +00:00
Alexander Krotov
0c4b3f71e5
Check for MOVE capability before using MOVE command
2020-02-12 11:38:18 +00:00
holger krekel
875e89e71a
better event information for moved messages
2020-02-11 20:38:14 +01:00
Alexander Krotov
66fdb447f7
Rename get_headerdef into get_header_value
2020-02-11 01:59:41 +03:00
Alexander Krotov
c801775a39
Implement get_headerdef method for MailHeader slices
2020-02-11 01:59:41 +03:00
Alexander Krotov
3150901b6e
Improve logs for prefetch checks
2020-02-09 23:28:29 +00:00
Alexander Krotov
4f6745b742
Check if contact is blocked or accepted before downloading it
2020-02-09 23:28:29 +00:00
Alexander Krotov
4fd4cc709d
Prefetch FROM field
2020-02-09 23:28:29 +00:00
Alexander Krotov
0fac463144
Prefetch Message-ID header instead of envelope
...
Envelope has the same Message-ID, but using other fields from the
envelope, such as From field, is error-prone. They may contain values
different from the message body. As we don't parse the envelope later on,
it is better not to fetch it during prefetch too.
2020-02-09 23:28:29 +00:00
Alexander Krotov
d809dfac65
Do not download messages that are not displayed
2020-02-09 23:28:29 +00:00
Alexander Krotov
ea11a5274e
Remove unwrap() in prefetch_get_message_id
2020-02-09 23:28:29 +00:00
Alexander Krotov
42356c2a67
Fix a typo in prefetch_get_message_id
2020-02-09 23:28:29 +00:00
Alexander Krotov
df252c4704
Do not check for XLIST capability
...
This capability is not used by Delta Chat. Moreover, XLIST is deprecated
in favor of https://tools.ietf.org/html/rfc6154 , which should be
supported instead. Delta Chat already looks for \Sent attribute in
get_folder_meaning().
2020-02-09 19:15:20 +01:00
Alexander Krotov
d1912f873b
Resultify fetch_single_msg
2020-02-09 19:14:36 +01:00
Alexander Krotov
d83652b0fc
Add standard reference for UID FETCH quirk
2020-02-02 12:46:31 +00:00
dignifiedquire
a8fa644d25
feat: update to latest async-imap
2020-01-28 17:44:34 +03:00
B. Petersen
0043e95ba7
fix message deletion on server
...
before a message is actually deleted,
we verify that server_folder+server_uid matches the Message-ID,
so that we do not delete the wrong message by accident.
the reason for that is that, to my knowledge, server_folder+server_uid
are not necessarily stable but Message-ID is.
anyway, this check was broken and set the server_uid to 0 in all cases -
where it should be set to 0 _only_ on mismatches.
2020-01-21 16:27:21 +03:00
Alexander Krotov
e3031462c1
Replace expect() in select_with_uidvalidity with an Error
2019-12-16 14:44:52 +03:00
Alexander Krotov
8d3e536582
Do not panic on SystemTimeDifference
2019-12-15 19:56:13 +01:00
Alexander Krotov
1de535363d
Move parse_message_id from wrapmime.rs to imap/mod.rs
2019-12-15 19:13:49 +03:00