Commit graph

296 commits

Author SHA1 Message Date
Remy Vuong
d6a6592420 Changed: a typo was fixed 2020-05-19 10:41:38 +02:00
Jon Gjengset
cf4aed569b
Make UnsolicitedResponse non_exhaustive
That way, as we discover additional unilateral responses in the future,
we won't have to make a breaking change to add them.
2020-05-18 14:12:36 -04:00
Jon Gjengset
0c3ce7943d
Expose unilateral mailbox flag changes
This is a backwards incompatible change, since it adds a variant to a
public enum.
2020-05-18 14:12:13 -04:00
Jon Gjengset
464c59e6c1
Expunge holds a Seq 2020-05-18 14:10:28 -04:00
Jon Gjengset
b74bfa79c6
FLAGS can be sent as unilateral response
Fixes #161 (well, the side-issue in #161).
2020-05-18 14:03:16 -04:00
Massimo Redaelli
80a0aae69d Support timing out wait on IDLE 2020-05-12 09:53:13 +02:00
Todd Mortimer
746bdfe6b9 Handle Dovecot's periodic IDLE notification messages ("OK Still here").
These messages show up at an interval controlled by Dovecot's
imap_idle_notify_interval setting, which defaults to 2 minutes.
These messages were causing the IDLE loop to exit prematurely
because it looks like a notification response from the server.
2020-04-19 10:25:41 -04:00
Todd Mortimer
41c0eb91d6 Make Display implementation independent of deprecated Error::description.
Allow use of deprecated in existing Error::description implementation to
suppress warnings.
2020-03-29 19:27:07 -04:00
Jon Gjengset
949ea3bd6b
Bump dependencies
This also pulls in imap-proto 0.11, which exposes message envelopes as
`&[u8]` instead of `&str`. This directly affects our public API.
2020-02-20 12:49:25 -05:00
Dillen Meijboom
391caf042a
Ignore server comments 2020-02-20 17:22:53 +01:00
Celti Burroughs
a4b03568be
Add imap::connect_starttls convenience function
Add a `imap::connect_starttls` convenience function, with the same
syntax as `imap::connect`, to make STARTTLS connections as easily as
IMAPS.

PR#140 removed `imap::connect_insecure` with the stated goal of
encouraging users to connect securely. With that change, users are
forced to construct their own `TcpStream`s when interacting with
non-IMAPS servers.

This change may perversely incentivise the use of insecure connections,
instead of discouraging them, as users may blindly copy-paste code
involving `Client::new` and `TcpStream`s so things "just work", without
the visual indicator of `_insecure` suggesting something is wrong.

Tangentially, [RFC 2595] encourages using STARTTLS instead of raw SSL
sockets. Ideally, we should support both options equally well.

[RFC 2595]: https://tools.ietf.org/html/rfc2595#section-7
2019-11-30 05:18:05 -07:00
sergey
18526ffb61 Add bodystructure exposing function to Fetch structure. 2019-10-29 13:55:07 +02:00
Friedel Ziegelmayer
465481de88 fix(auth): handle single + response (#145) 2019-10-21 10:49:15 -04:00
Friedel Ziegelmayer
0e5aa5c004 feat: expose read_greeting (#144)
This is sometimes needed when manually using `Client::new()`.

We enforce that the greeting is read at most once.
2019-10-21 10:13:39 -04:00
Lem
39b8087b3c
Update src/client.rs
Fix typo in fix for typo.

It's not 'data_times' or 'data_itmes'. It should be 'data_items'!

Co-Authored-By: Jon Gjengset <jon@thesquareplanet.com>
2019-10-18 20:31:34 +02:00
Lemm
e41b235387 Fix typo in documentation
data_times should be data_items for
function "status"
2019-10-18 20:23:10 +02:00
Bryce Fisher-Fleig
97671062ee (doc) Explain how and why to opt out of native_tls
Also point out the examples/rustlts.rs file for pure Rust TLS goodness
2019-09-24 08:13:17 -07:00
Bryce Fisher-Fleig
29fece1221 (security) Remove connect_insecure
In order to discourage folks from connecting securely, we're removing the
convenience method imap::connect_insecure.

Fear not\! For those who manage security in another way (aka a private network
or similar measures), it is still possible to connect without TLS by using the
imap::Client::new() method. See that method for examples of how to do this.
2019-09-24 08:13:17 -07:00
Bryce Fisher-Fleig
f15bdfb458 (feat) default feature for native_tls (aka openssl)
Establishes conditional compilation for all integration with the
native_tls crate in this crate. Since native_tls has been deeply
integrated into this crate for a long time, we want to maintain
backwards compatibility by making this feature part of the default.

For a consumer of this crate to "opt-out", including this in
cargo.toml:

```
[dependencies.imap]
version = 0.16.0        # Replace this with the correct version
default-features = false
```

See the conversation on Github for details on this approach:
https://github.com/jonhoo/rust-imap/issues/123
2019-09-24 08:13:17 -07:00
Bryce Fisher-Fleig
beb41d2f52 (feat) Provide example integration with Rustls crate
By checking this code in as an example, we can prevent bitrot as we continuously test this
in CI. It also demonstrates how to setup TLS without relying on platform specific dependencies
via native_tls crate.
2019-09-17 12:51:38 -07:00
Alexander Krotov
2221cd2e18
Update imap-proto and test that "IMAP4REV1" capability is accepted
See issue https://github.com/djc/tokio-imap/issues/54
2019-09-04 18:08:12 +03:00
avitex
c5f4495be7
Make capabilities has_str case insensitive 2019-09-04 20:25:51 +10:00
avitex
caf3990c10
Fix grammar 2019-09-03 23:41:58 +10:00
avitex
ff48dc9755
Decrease alloc on auth resp parsing 2019-09-03 23:41:57 +10:00
Jon Gjengset
2aa8c87e35
Move to 2018 edition 2019-09-03 09:35:15 -04:00
avitex
1c51fbe3ac
Make clippy happy again 2019-09-02 23:44:18 +10:00
avitex
1c348a4ffa
Make has_str input generic 2019-09-02 23:02:51 +10:00
avitex
ff8e638591
Fix dyn warnings 2019-09-02 23:01:40 +10:00
Lucas
3a5c2e9d91
Implemented new enumerated Capabilities from imap-proto crate. 2019-09-02 23:00:40 +10:00
Jon Gjengset
0250e3e2b2
Make clippy happy again 2019-06-28 17:41:29 -04:00
Baudouin Feildel
e9f6a33bd5 Add Fetch.internal_date method (#113)
This method gives the parsed internal date from the FETCH answer.
2019-06-28 17:39:10 -04:00
Jon Gjengset
466c06c1f2
Avoid unnecessary import 2019-04-29 12:07:04 -04:00
Niklas Claesson
b35823da7c Fix quoting issue in LIST command 2019-04-28 21:59:55 +02:00
Jon Gjengset
c0e1fbba0c
Avoid duplicating unilateral response handling 2019-03-18 21:43:30 -04:00
Jon Gjengset
b0ac079c30
rustfmt 2019-03-18 21:37:39 -04:00
Jon Gjengset
a7a2798bf1
Merge pull request #110 from Emm54321/fix-noop
Handle unsolicited responses in noop.
2019-03-18 21:35:43 -04:00
Jon Gjengset
85d34f3735
Move to travis-ci.com 2019-03-17 12:46:14 -04:00
Jon Gjengset
5577fa678e
for old Rust too 2019-03-17 12:43:11 -04:00
Jon Gjengset
1dd4b31fa2
clippy 2019-03-17 12:39:29 -04:00
Emmanuel Lesueur
5df0759446 Handle unsolicited responses in noop. 2019-03-16 13:31:52 +01:00
Seo Sanghyeon
d01eb40de0 Fix uid_fetch doc 2019-02-22 01:48:50 +09:00
Jon Gjengset
ead7d2173b
rustfmt beta 2018-12-10 10:14:09 -05:00
Jon Gjengset
67ee2f5175
Bump version for imap-proto fixes
- A `NIL` hierarchy delimiter in a `Name` is now properly parsed and exposed as `None`
 - `RFC822.TEXT` responses are now returned by `Fetch::text()`.
2018-12-07 16:34:57 -05:00
Jon Gjengset
1b086d40de
Prep for 2018 edition [skip ci] 2018-11-28 09:44:01 -05:00
Jon Gjengset
86d4da84d7
Note that we support older stable versions
[skip ci]
2018-11-24 15:16:29 -05:00
Jon Gjengset
b6e9ea080b
Make crate compile on Rust 1.26.2+ 2018-11-24 14:17:15 -05:00
Jon Gjengset
a610283861
Fix nightly clippy warning 2018-11-24 12:45:07 -05:00
Jon Gjengset
5dc51ac6b1
Show example of how to use store to delete 2018-11-22 17:57:56 -05:00
Jon Gjengset
357603b15f
Empty string != "" 2018-11-22 17:57:41 -05:00
Jon Gjengset
2b17bc0538
Make all public methods generic over str ref 2018-11-22 17:57:05 -05:00