holger krekel
911c0e45dc
expose empty server functionality and test it (also introducing a new DC_EVENT_IMAP_FOLDER_EMPTIED event)
2019-10-29 22:19:13 +01:00
holger krekel
7628ee1e05
rust-part of empty_server
2019-10-29 22:19:13 +01:00
holger krekel
de3e5e1c39
fix deadlock issue with config access
2019-10-29 16:08:24 +01:00
B. Petersen
27627b4f74
show better error message for a simple 'bad credentials' error and give some more hints for other errors
2019-10-29 16:08:24 +01:00
Floris Bruynooghe
c8d296ea0e
A MsgId newtype
...
This more strongly types the ubiquitous message id type by no longer
making it an integer. It keeps the actual ID opaque. Only for the
generic job API the number keeps being used. Some locations also need
to create it from an integer and call MsgId::new().
2019-10-29 15:30:53 +01:00
holger krekel
b4464ab0a3
address @dignifiedquire comments
2019-10-28 20:51:17 +01:00
holger krekel
1cc4f56025
make imap-idle survive disconnects (during and at the beginning of an app)
2019-10-28 20:51:17 +01:00
holger krekel
1d03e0822e
seems to work
2019-10-28 20:51:17 +01:00
B. Petersen
049077f13b
reconnect on io errors and broken pipes
2019-10-22 09:58:05 +02:00
dignifiedquire
076616bfb9
fix(imap): read server greeting
2019-10-20 13:10:17 +02:00
Alexander Krotov
66e53e6804
Return bool from Imap::fetch()
...
It is unused anyway
2019-10-11 21:52:47 +02:00
holger krekel
7f5b362eda
remove ok_to_continue and simplify/refactor imap and smtp connection trying
...
address @r10s review comments and also remove unneccessary "unsafe fn"
2019-10-07 13:39:01 +02:00
B. Petersen
2317518e5e
cargo fmt
2019-10-04 23:07:34 +02:00
B. Petersen
477af413c6
if in doubt, prefer unwrap_or_default()
...
if the past we had lots of crashes because of unexpected unwrap failures,
mostly related to string.
this commit avoids them eg. for string-conversions that may panic
eg. when encountering a null-byte or by logical programming errors
where an object is assumed to be set but is not under unexpected circumstances.
2019-10-04 23:07:33 +02:00
B. Petersen
93f0f5ccae
rename sql-config-setters to set_raw_config*()
...
the rename is reasonable as the getter is called get_raw_config*()
and to make the functional difference to context.set|get_config() clearer.
2019-10-04 11:18:26 +02:00
B. Petersen
dca9afa10b
rename sql.get_config() to sql.get_raw_config() to make clearer that there is not default handling
2019-10-03 17:35:43 +02:00
Alexander Krotov
130d485cac
Fix some clippy warnings
2019-10-03 14:30:40 +02:00
Alexander Krotov
216266d7bf
Apply imap_certificate_checks config to StartTLS connections
2019-10-03 02:02:51 +03:00
Alexander Krotov
bf1652a1be
Move common code for IMAP and SMTP to login_param.rs
2019-10-03 01:26:38 +03:00
Alexander Krotov
6343ae8161
Rename {mail,send}_certificate_checks into {imap,smtp}_certificate_checks
2019-10-03 01:26:07 +03:00
Alexander Krotov
063d989225
Use mail_certificate_checks configuration in imap.rs
2019-10-03 01:26:07 +03:00
holger krekel
509a21ff05
introduce DC_IMAP_MESSAGE_MOVED event and try harder to send out MDNs
2019-10-02 23:51:14 +02:00
holger krekel
96066712bd
add and test for DC_IMAP_MESSAGE_DELETED event
2019-10-02 23:51:14 +02:00
holger krekel
d83aa1e898
perform heuristic moves only if a job is not delete
2019-10-02 23:51:14 +02:00
holger krekel
f0a7bdb6d6
properly parse message ids in imap prefetch
2019-10-02 23:51:14 +02:00
holger krekel
9c077c98cd
remove MdnSent logic
2019-10-02 23:51:14 +02:00
holger krekel
6dc45642b7
rework API
2019-10-02 23:51:14 +02:00
holger krekel
86369148ee
fix #616 -- allow invalid certs for smtp and imap connections -- this is the behaviour of C-core.
2019-09-27 21:44:21 +02:00
Alexander Krotov
3933353b5f
Pass slice to dc_receive_imf
...
instead of pointer and length
2019-09-27 17:53:41 +03:00
dignifiedquire
0bdcc3d616
refactor(message): remove remaining unsafe and c types
2019-09-21 16:37:19 +02:00
dignifiedquire
1265016a55
refactor(message): rustiy api
2019-09-21 16:37:19 +02:00
Dmitry Bogatov
2f5d74dbf4
Remove unused constants from src/imap.rs
2019-09-20 17:35:26 +00:00
Dmitry Bogatov
4bf5ba594c
Make Imap::set_mdnseen return enum, not int
2019-09-20 17:35:26 +00:00
Dmitry Bogatov
6e2da27f45
Change return type of Imap::set_seen to enum
2019-09-20 17:35:26 +00:00
Dmitry Bogatov
6ee9465d43
Make return type of Image::mv an enum
...
Replace named constants with enum to improve type-safety and make
exhausiveness checks possible.
Note, that since this enum never pass FFI border, its numeric values
does not need to be specified explicitly and can be left on compiler's
discretion.
2019-09-20 17:35:25 +00:00
Dmitry Bogatov
391a6bf422
Replace numbers with named constants
2019-09-20 17:35:25 +00:00
holger krekel
0c88bc6ac7
more rfc724_mid cleanup
2019-09-19 20:03:16 +02:00
Dmitry Bogatov
95d8665dbe
Refine signature of dc_get_oauth2_access_token()
...
Previously, `dc_get_oauth2_access_token` accepted "flags" argument,
that actually had only one possible field: 0x1 == DC_REGENERATE.
This change replaces "flags" argument with single boolean argument
"regenerate".
2019-09-18 19:29:39 +02:00
dignifiedquire
0bf3d20e07
fix and implement ffi tranlation
2019-09-15 23:40:08 +02:00
dignifiedquire
5486ac5b9f
refacor: use an enum for events
2019-09-15 23:40:08 +02:00
dignifiedquire
16c281a9b7
refactor(context): safe interface
2019-09-15 16:36:31 +02:00
dignifiedquire
f31f341a50
feat: enforce Debug implementations and remove mod types
2019-09-15 16:36:31 +02:00
Dmitry Bogatov
57daa0f7f0
Remove useless argument of logging macros
...
Previously, logging macros (info! warn! error!) accepted integer
argument (data1), that was passed to callback function verbatim. In all
call sites this argument was 0.
With this change, that data1 argument is no longer part of macro
interface, 0 is always passed to callback in internals of these macros.
2019-09-10 22:26:47 +00:00
dignifiedquire
f3e53a05a6
refactor(loginparam): rename dc_loginparam -> login_param
2019-09-08 18:48:57 +02:00
dignifiedquire
dd381a5c1c
refactor(loginparam): simplify and rustify
2019-09-08 18:48:57 +02:00
Alexander Krotov
46520edd87
Print error if CAPABILITY command fails.
2019-09-04 15:12:00 +02:00
Alexander Krotov
489f25940f
Update to the latest rust-imap
...
It uses imap-proto 0.8.1 instead of outdated 0.7.0.
2019-09-03 19:14:56 +03:00
Dmitry Bogatov
723624b3f7
Fix one clippy::unneeded_unwrap warning
2019-08-28 00:06:49 +00:00
Dmitry Bogatov
2d00495d29
Fix one clippy::unneeded_unwrap warning
2019-08-28 00:01:09 +00:00
Friedel Ziegelmayer
a906faeb35
refactor: a rusty job
...
* refactor(jobthread): safe and rusty
* refactor(job): rusty and safe
2019-08-19 12:07:13 +02:00