diff --git a/.cirrus.yml b/.cirrus.yml
index e5b9afd..eab595f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -11,12 +11,12 @@ task:
- . $HOME/.cargo/env
check_script:
- . $HOME/.cargo/env
- - cargo check --all-targets
+ - cargo check --all-targets --all-features
build_script:
- . $HOME/.cargo/env
- - cargo build --all-targets --verbose
+ - cargo build --all-targets --verbose --all-features
test_script:
- . $HOME/.cargo/env
- - cargo test --examples
- - cargo test --doc
- - cargo test --lib
+ - cargo test --examples --all-features
+ - cargo test --doc --all-features
+ - cargo test --lib --all-features
diff --git a/Cargo.toml b/Cargo.toml
index 929eca9..37b678c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,10 +15,12 @@ categories = ["email", "network-programming"]
[features]
tls = ["native-tls"]
+rustls-tls = ["rustls-connector"]
default = ["tls"]
[dependencies]
native-tls = { version = "0.2.2", optional = true }
+rustls-connector = { version = "0.13.1", optional = true }
regex = "1.0"
bufstream = "0.1"
imap-proto = "0.14.1"
@@ -45,6 +47,18 @@ required-features = ["default"]
name = "idle"
required-features = ["default"]
+[[example]]
+name = "rustls"
+required-features = ["rustls-tls"]
+
+[[example]]
+name = "starttls"
+required-features = ["default"]
+
+[[example]]
+name = "timeout"
+required-features = ["default"]
+
[[test]]
name = "imap_integration"
required-features = ["default"]
diff --git a/README.md b/README.md
index 2e74966..af2f8aa 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ results](https://dev.azure.com/jonhoo/jonhoo/_build/latest?definitionId=11&branc
[@jonhoo]: https://thesquareplanet.com/
-To connect, use the [`connect`] function. This gives you an unauthenticated [`Client`]. You can
+To connect, use the [`ClientBuilder`]. This gives you an unauthenticated [`Client`]. You can
then use [`Client::login`] or [`Client::authenticate`] to perform username/password or
challenge/response authentication respectively. This in turn gives you an authenticated
[`Session`], which lets you access the mailboxes at the server.
@@ -34,16 +34,9 @@ in the documentation for the various types and methods and read the raw text the
Below is a basic client example. See the `examples/` directory for more.
```rust
-extern crate imap;
-extern crate native_tls;
-
fn fetch_inbox_top() -> imap::error::Result