From 7b3a9e4cc754e5781f39071fd0f0a263f0c69ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Wed, 29 Mar 2023 18:09:39 +0200 Subject: [PATCH] improve cargo features naming and organization --- Cargo.lock | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 17 ++++++-- 2 files changed, 134 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4140dc5..f5c8336 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -804,7 +804,7 @@ dependencies = [ [[package]] name = "himalaya-lib" version = "0.6.0" -source = "git+https://git.sr.ht/~soywod/himalaya-lib?branch=develop#43c2b5dbde3e6f6c2e76ad36b25d123ab3098b10" +source = "git+https://git.sr.ht/~soywod/himalaya-lib?branch=develop#7b8fb1d073b66d2f1d642df109c787ba3c31378f" dependencies = [ "ammonia", "chrono", @@ -822,18 +822,22 @@ dependencies = [ "mime-msg-builder", "native-tls", "notmuch", + "once_cell", "ouroboros", "proc-lock", "rayon", "regex", "rfc2047-decoder", "rusqlite", + "rustls", + "rustls-native-certs", "shellexpand", "thiserror", "tree_magic", "urlencoding", "utf7-imap", "uuid", + "webpki-roots", ] [[package]] @@ -937,6 +941,7 @@ dependencies = [ "nom 7.1.1", "ouroboros", "regex", + "rustls-connector", ] [[package]] @@ -1041,9 +1046,12 @@ dependencies = [ "nom 7.1.1", "once_cell", "quoted_printable", + "rustls", + "rustls-pemfile", "serde", "socket2", "tokio", + "webpki-roots", ] [[package]] @@ -1785,6 +1793,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "roff" version = "0.2.1" @@ -1819,6 +1842,51 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-connector" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c6a18f8d10f71bce9bca6eaeb80429460e652f3bcf0381f0c5f8954abf7b3b8" +dependencies = [ + "log", + "rustls", + "rustls-native-certs", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + [[package]] name = "ryu" version = "1.0.11" @@ -1847,6 +1915,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.7.0" @@ -1950,6 +2028,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "stacker" version = "0.1.15" @@ -2199,6 +2283,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -2326,6 +2416,35 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 954cf14..9c64cee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,11 +16,22 @@ priority = "optional" section = "mail" [features] +default = ["imap-backend", "smtp-sender", "native-tls"] + +# backends imap-backend = ["himalaya-lib/imap-backend"] -smtp-sender = ["himalaya-lib/smtp-sender"] notmuch-backend = ["himalaya-lib/notmuch-backend"] -vendored = ["himalaya-lib/vendored"] -default = ["imap-backend", "smtp-sender"] + +# senders +smtp-sender = ["himalaya-lib/smtp-sender"] + +# native tls +native-tls = ["himalaya-lib/native-tls"] +native-tls-vendored = ["himalaya-lib/native-tls-vendored"] + +# rustls +rustls-tls = ["himalaya-lib/rustls-tls"] +rustls-native-certs = ["himalaya-lib/rustls-native-certs"] [dev-dependencies] tempfile = "3.3"