Alexander Krotov
3ee81cbee0
Revert "imap: simplify select_folder() interface"
...
This reverts commit b614de2f80 .
2020-05-13 11:36:33 +02:00
Alexander Krotov
cc56edc91d
Log precheck_imf errors
2020-05-11 00:19:14 +03:00
bjoern
c5eb112f5a
Merge pull request #1465 from deltachat/smtp-network-error
...
Better SMTP ErrorNetwork message
2020-05-10 23:05:20 +02:00
B. Petersen
aa292ac6b8
do normal receive_imf() if message-id is empty or if prefetch failed for other reasons. there are servers not sending a message ids, this and other cases is handled in receive_imf() - but not in prefetch (would be too much to maintain, also we need more information). this normal processing also prevents trying over the same message over and over as the server_uid is updated.
2020-05-10 22:43:04 +02:00
Alexander Krotov
c36227e2fc
Better SMTP ErrorNetwork message
...
It uses stock string, just as for IMAP errors, and is distinguishable
from IMAP errors: protocol is specified in the error message now.
2020-05-10 23:24:03 +03:00
Hocuri
a586a1d525
Fix #1120 Contact requests are not shown when name of sender includes a comma character ( #1438 )
...
* First try making get_recipients use MailHeader (nice and functional)
* Get it to compile by using not-so-functional style
* Add "empty-from" test, drop unnecessary check for error; continue using addrparse_header() instead of addrparse()
* Try to use functional style, unfortunately, I can't get the compiler to accept it
* Do it imperative-style: Do not overwrite To with Cc and vice versa
* Use addrparse_header() once more
* Still addrparse_header()
* Clippy
* Fix compile errors in tests
* Fix typo
* Fix tests again ;-)
* Code style
* Code style; try a HashMap<addr: String, display_name: String> as an address list but I am not convinced
* Code style; Use Vec<SingleInfo> as address list
* Clippy
* Add tests
* Add another test
* Remove stale comments
2020-05-07 13:55:09 +02:00
Alexander Krotov
6543c7c26f
fetch_single_msg: do not ignore dc_receive_imf errors
...
If error is ignored, the message will never be fetched again, even if
there was a database write error.
dc_receive_imf itself is modified to ignore unrecoverable errors, to
prevent endless refetching of incorrect messages.
2020-05-04 18:19:32 +03:00
Alexander Krotov
e8763e936d
imap: simplify select_folder() interface
...
Accept AsRef<str> instead of Option<impl AsRef<str>>.
There is no need to pass None to force expunge anymore.
2020-04-30 23:48:41 +03:00
Alexander Krotov
c41a6b87b8
imap: always close folder before selecting if expunge is needed
2020-04-30 23:48:41 +03:00
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
dignifiedquire
307a3e078e
Merge remote-tracking branch 'origin/master' into feat/async-jobs
2020-04-09 23:41:34 +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
dignifiedquire
49b2f80ded
Merge remote-tracking branch 'origin/master' into feat/async-jobs
2020-03-26 16:52:07 +01:00
B. Petersen
e09a0a548f
using first() instead of [0]
2020-03-25 18:10:02 +01:00
dignifiedquire
97951aec15
implement imape secure upgrade
2020-03-25 15:41:27 +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
dignifiedquire
8a7eaba668
fix imap fetch loop and watch folders
2020-03-21 16:26:27 +01:00
dignifiedquire
9d313b4e0e
cleanup and fix most of imap
2020-03-18 16:29:34 +01:00
dignifiedquire
f85b14a7f7
the basics work
2020-03-18 15:11:36 +01:00
dignifiedquire
563b550f08
integrate imex and imap
2020-03-18 01:50:19 +01:00
dignifiedquire
aa45716ef7
cleanup and setup configure
2020-03-18 00:36:13 +01:00
dignifiedquire
ce5b95f8e5
start setting up new scheduler
2020-03-17 13:48:03 +01:00
dignifiedquire
6db253e1cc
rebase fixes
2020-03-14 15:21:19 +01:00
dignifiedquire
818e921192
it compiles
2020-03-14 15:17:47 +01:00
dignifiedquire
6ea1d665bb
start making sql async
2020-03-14 15:17:23 +01:00
dignifiedquire
7326ba1403
send bounds wip
2020-03-14 15:16:27 +01:00
dignifiedquire
62bfa5157b
async sleep
2020-03-14 15:16:27 +01:00
dignifiedquire
618202cf8b
more async
2020-03-14 15:16:27 +01:00
dignifiedquire
9614a23506
first pass at async job
2020-03-14 15:14:49 +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