From cec658aff4bb764b507683fcb125fa3de4fea5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Sat, 25 Nov 2023 12:37:00 +0100 Subject: [PATCH] bump lib with backend features --- Cargo.lock | 2730 +++++++++++++++++---------- Cargo.toml | 16 +- config.sample.toml | 60 +- src/backend.rs | 237 +++ src/cache/id_mapper.rs | 73 +- src/config/config.rs | 68 +- src/config/prelude.rs | 221 ++- src/domain/account/accounts.rs | 45 +- src/domain/account/config.rs | 223 +-- src/domain/account/handlers.rs | 137 +- src/domain/account/wizard.rs | 6 +- src/domain/backend/imap/handlers.rs | 1 - src/domain/backend/imap/mod.rs | 4 +- src/domain/backend/maildir/mod.rs | 2 +- src/domain/backend/mod.rs | 2 +- src/domain/email/handlers.rs | 196 +- src/domain/flag/handlers.rs | 25 +- src/domain/folder/handlers.rs | 23 +- src/domain/sender/mod.rs | 2 +- src/domain/sender/sendmail/mod.rs | 2 +- src/domain/sender/smtp/mod.rs | 2 +- src/domain/sender/wizard.rs | 1 - src/domain/tpl/handlers.rs | 35 +- src/lib.rs | 1 + src/main.rs | 301 ++- src/ui/editor.rs | 14 +- 26 files changed, 2622 insertions(+), 1805 deletions(-) create mode 100644 src/backend.rs diff --git a/Cargo.lock b/Cargo.lock index 1b1f4de..b3bfaa3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,15 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -26,9 +35,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", @@ -37,41 +46,22 @@ dependencies = [ [[package]] name = "ahash" -version = "0.3.8" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" -dependencies = [ - "const-random", -] - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.8", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", - "getrandom 0.2.8", + "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -82,6 +72,18 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -92,31 +94,85 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.66" +name = "anstream" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -136,6 +192,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base16ct" version = "0.2.0" @@ -156,9 +227,9 @@ checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -180,9 +251,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -214,15 +285,24 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", - "regex-automata", + "regex-automata 0.4.3", "serde", ] +[[package]] +name = "btoi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" +dependencies = [ + "num-traits", +] + [[package]] name = "buffer-redux" version = "1.0.0" @@ -247,27 +327,27 @@ checksum = "b00b8763668c99f8d9101b8a0dd82106f58265464531a79b2cef0d9a30c17dd2" [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecount" -version = "0.6.3" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2" @@ -311,11 +391,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.77" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -329,9 +410,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", "target-lexicon", @@ -343,49 +424,33 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "charset" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e9079d1a12a2cc2bffb5db039c43661836ead4082120d5844f02555aca2d46" -dependencies = [ - "base64 0.13.1", - "encoding_rs", -] - [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] name = "chumsky" -version = "0.8.0" +version = "1.0.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4" +checksum = "8edacfd1c8ea3db7e11640b5444a1703baee4c3b8c21ffd0726e09a92ab9abe5" dependencies = [ - "ahash 0.3.8", -] - -[[package]] -name = "chumsky" -version = "1.0.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc3172a80699de358070dd99f80ea8badc6cdf8ac2417cb5a96e6d81bf5fe06d" -dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.2", + "regex-automata 0.3.9", + "serde", "stacker", + "unicode-ident", + "vergen", ] [[package]] @@ -400,96 +465,80 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ - "bitflags 1.3.2", + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "is-terminal", "strsim 0.10.0", - "termcolor", ] [[package]] name = "clap_complete" -version = "4.0.6" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3c9eae0de7bf8e3f904a5e40612b21fb2e2e566456d177809a48b892d24da" +checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" dependencies = [ "clap", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clap_mangen" -version = "0.2.5" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e503c3058af0a0854668ea01db55c622482a080092fede9dd2e00a00a9436504" +checksum = "d3be86020147691e1d2ef58f75346a3d4d94807bfc473e377d52f09f0f7d77f7" dependencies = [ "clap", "roff", ] [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "clru" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" -version = "0.15.2" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", - "terminal_size", "unicode-width", - "winapi", + "windows-sys 0.45.0", ] [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - -[[package]] -name = "const-random" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" -dependencies = [ - "const-random-macro", - "proc-macro-hack", -] - -[[package]] -name = "const-random-macro" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" -dependencies = [ - "getrandom 0.2.8", - "once_cell", - "proc-macro-hack", - "tiny-keccak", -] +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -524,9 +573,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "coredump" @@ -539,9 +588,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -561,21 +610,11 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -584,40 +623,34 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", + "memoffset 0.9.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -644,27 +677,14 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "4.0.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ace70fc06e06f7f689d2624dc4e2f0ea666efb5aa704215f7249ae6e047a7" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest 0.10.6", + "digest", "fiat-crypto", "platforms", "rustc_version", @@ -674,13 +694,13 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -689,50 +709,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" -[[package]] -name = "cxx" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 1.0.104", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.104", -] - [[package]] name = "darling" version = "0.10.2" @@ -764,7 +740,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.9.3", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -778,7 +754,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -789,7 +765,7 @@ checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core 0.10.2", "quote", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -800,26 +776,35 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core 0.14.4", "quote", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive_builder" version = "0.12.0" @@ -838,7 +823,7 @@ dependencies = [ "darling 0.14.4", "proc-macro2", "quote", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -848,7 +833,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ "derive_builder_core", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -862,29 +847,21 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92e7e37ecef6857fdc0c0c5d42fd5b0938e46590c2183cc92dd310a6d078eb1" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" dependencies = [ "console", + "shell-words", "tempfile", "zeroize", ] [[package]] name = "digest" -version = "0.9.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "const-oid", @@ -898,7 +875,16 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -913,13 +899,31 @@ dependencies = [ ] [[package]] -name = "ecdsa" -version = "0.16.7" +name = "dirs-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest 0.10.6", + "digest", "elliptic-curve", "rfc6979", "signature", @@ -928,9 +932,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.1" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", "signature", @@ -938,39 +942,40 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0-rc.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa8e9049d5d72bfc12acbc05914731b5322f79b5e2f195e9f2d705fca22ab4c" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek 4.0.0-rc.3", + "curve25519-dalek", "ed25519", "serde", "sha2", + "subtle", "zeroize", ] [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.6", + "digest", "ff", "generic-array", "group", "hkdf", "pem-rfc7468", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -979,14 +984,13 @@ dependencies = [ [[package]] name = "email-lib" version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ea77debd2ffe4299a58f5a4718d13d1b97faef45555f9ec3cb3db74721076" dependencies = [ "advisory-lock", + "anyhow", "async-trait", "chrono", "convert_case", - "dirs", + "dirs 4.0.0", "futures", "imap", "imap-proto", @@ -997,29 +1001,28 @@ dependencies = [ "mail-send", "maildirpp", "md5", - "mml-lib", + "mml-lib 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "notmuch", - "oauth-lib", + "oauth-lib 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "ouroboros", "pgp-lib", "process-lib", "rayon", "regex", - "rfc2047-decoder", "rusqlite", - "rustls 0.21.1", + "rustls 0.21.9", "rustls-native-certs", "secret-lib", - "shellexpand-utils", + "shellexpand-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "tokio", - "tokio-rustls 0.24.0", + "tokio-rustls", "tree_magic_mini", "urlencoding", "utf7-imap", "uuid", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -1039,23 +1042,23 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] name = "enum-as-inner" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", ] [[package]] @@ -1079,32 +1082,21 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.23" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54558e0ba96fbe24280072642eceb9d7d442e32c7ec0ea9e7ecd7b4ea2cf4e11" +checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" dependencies = [ "serde", ] [[package]] name = "errno" -version = "0.2.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", "libc", + "windows-sys 0.48.0", ] [[package]] @@ -1121,12 +1113,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.8.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "ff" @@ -1134,15 +1123,27 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] [[package]] name = "fixedbitset" @@ -1152,9 +1153,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1168,9 +1169,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1193,14 +1194,14 @@ dependencies = [ "darling 0.10.2", "proc-macro2", "quote", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] name = "futures" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1213,9 +1214,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1223,15 +1224,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1240,38 +1241,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1298,36 +1299,571 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a329e22866dd78b35d2c639a4a23d7b950aeae300dfd79f4fb19f74055c2404" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "gix" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c256ea71cc1967faaefdaad15f334146b7c806f12460dcafd3afed845c8c78dd" +dependencies = [ + "gix-actor", + "gix-attributes", + "gix-config", + "gix-credentials", + "gix-date", + "gix-diff", + "gix-discover", + "gix-features 0.28.1", + "gix-glob", + "gix-hash 0.10.4", + "gix-hashtable", + "gix-index", + "gix-lock", + "gix-mailmap", + "gix-object", + "gix-odb", + "gix-pack", + "gix-path", + "gix-prompt", + "gix-ref", + "gix-refspec", + "gix-revision", + "gix-sec", + "gix-tempfile", + "gix-traverse", + "gix-url", + "gix-validate", + "gix-worktree", + "log", + "once_cell", + "signal-hook", + "smallvec", + "thiserror", + "unicode-normalization", +] + +[[package]] +name = "gix-actor" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf" +dependencies = [ + "bstr", + "btoi", + "gix-date", + "itoa", + "nom", + "thiserror", +] + +[[package]] +name = "gix-attributes" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2231a25934a240d0a4b6f4478401c73ee81d8be52de0293eedbc172334abf3e1" +dependencies = [ + "bstr", + "gix-features 0.28.1", + "gix-glob", + "gix-path", + "gix-quote", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-bitmap" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-chunk" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-command" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" +dependencies = [ + "bstr", +] + +[[package]] +name = "gix-config" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbad5ce54a8fc997acc50febd89ec80fa6e97cb7f8d0654cb229936407489d8" +dependencies = [ + "bstr", + "gix-config-value", + "gix-features 0.28.1", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "log", + "memchr", + "nom", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-config-value" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09154c0c8677e4da0ec35e896f56ee3e338e741b9599fae06075edd83a4081c" +dependencies = [ + "bitflags 1.3.2", + "bstr", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-credentials" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "750b684197374518ea057e0a0594713e07683faa0a3f43c0f93d97f64130ad8d" +dependencies = [ + "bstr", + "gix-command", + "gix-config-value", + "gix-path", + "gix-prompt", + "gix-sec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2" +dependencies = [ + "bstr", + "itoa", + "thiserror", + "time", +] + +[[package]] +name = "gix-diff" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "103a0fa79b0d438f5ecb662502f052e530ace4fe1fe8e1c83c0c6da76d728e67" +dependencies = [ + "gix-hash 0.10.4", + "gix-object", + "imara-diff", + "thiserror", +] + +[[package]] +name = "gix-discover" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eba8ba458cb8f4a6c33409b0fe650b1258655175a7ffd1d24fafd3ed31d880b" +dependencies = [ + "bstr", + "dunce", + "gix-hash 0.10.4", + "gix-path", + "gix-ref", + "gix-sec", + "thiserror", +] + +[[package]] +name = "gix-features" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b76f9a80f6dd7be66442ae86e1f534effad9546676a392acc95e269d0c21c22" +dependencies = [ + "crc32fast", + "flate2", + "gix-hash 0.10.4", + "libc", + "once_cell", + "prodash", + "sha1_smol", + "thiserror", + "walkdir", +] + +[[package]] +name = "gix-features" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897" +dependencies = [ + "gix-hash 0.11.4", + "libc", +] + +[[package]] +name = "gix-fs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b37a1832f691fdc09910bd267f9a2e413737c1f9ec68c6e31f9e802616278a9" +dependencies = [ + "gix-features 0.29.0", +] + +[[package]] +name = "gix-glob" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" +dependencies = [ + "bitflags 1.3.2", + "bstr", +] + +[[package]] +name = "gix-hash" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a258595457bc192d1f1c59d0d168a1e34e2be9b97a614e14995416185de41a7" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-hash" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-hashtable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e55e40dfd694884f0eb78796c5bddcf2f8b295dace47039099dd7e76534973" +dependencies = [ + "gix-hash 0.10.4", + "hashbrown 0.13.2", + "parking_lot", +] + +[[package]] +name = "gix-index" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "717ab601ece7921f59fe86849dbe27d44a46ebb883b5885732c4f30df4996177" +dependencies = [ + "bitflags 1.3.2", + "bstr", + "btoi", + "filetime", + "gix-bitmap", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-lock", + "gix-object", + "gix-traverse", + "itoa", + "memmap2", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c693d7f05730fa74a7c467150adc7cea393518410c65f0672f80226b8111555" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-mailmap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b66aea5e52875cd4915f4957a6f4b75831a36981e2ec3f5fad9e370e444fe1a" +dependencies = [ + "bstr", + "gix-actor", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017" +dependencies = [ + "bstr", + "btoi", + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-validate", + "hex", + "itoa", + "nom", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-odb" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83af2e3e36005bfe010927f0dff41fb5acc3e3d89c6f1174135b3a34086bda2" +dependencies = [ + "arc-swap", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-object", + "gix-pack", + "gix-path", + "gix-quote", + "parking_lot", + "tempfile", + "thiserror", +] + +[[package]] +name = "gix-pack" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9401911c7fe032ad7b31c6a6b5be59cb283d1d6c999417a8215056efe6d635f3" +dependencies = [ + "clru", + "gix-chunk", + "gix-diff", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-hashtable", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-traverse", + "memmap2", + "parking_lot", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32370dce200bb951df013e03dff35b4233fc7a89458642b047629b91734a7e19" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-prompt" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3034d4d935aef2c7bf719aaa54b88c520e82413118d886ae880a31d5bdee57" +dependencies = [ + "gix-command", + "gix-config-value", + "nix", + "parking_lot", + "thiserror", +] + +[[package]] +name = "gix-quote" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" +dependencies = [ + "bstr", + "btoi", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e909396ed3b176823991ccc391c276ae2a015e54edaafa3566d35123cfac9d" +dependencies = [ + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", + "memmap2", + "nom", + "thiserror", +] + +[[package]] +name = "gix-refspec" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba332462bda2e8efeae4302b39a6ed01ad56ef772fd5b7ef197cf2798294d65" +dependencies = [ + "bstr", + "gix-hash 0.10.4", + "gix-revision", + "gix-validate", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-revision" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6f6ff53f888858afc24bf12628446a14279ceec148df6194481f306f553ad2" +dependencies = [ + "bstr", + "gix-date", + "gix-hash 0.10.4", + "gix-hashtable", + "gix-object", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" +dependencies = [ + "bitflags 1.3.2", + "dirs 4.0.0", + "gix-path", "libc", "windows", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "gix-tempfile" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "d71a0d32f34e71e86586124225caefd78dabc605d0486de580d717653addf182" dependencies = [ - "cfg-if", + "gix-fs", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "once_cell", + "parking_lot", + "signal-hook", + "signal-hook-registry", + "tempfile", ] [[package]] -name = "getrandom" -version = "0.2.8" +name = "gix-traverse" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "dd9a4a07bb22168dc79c60e1a6a41919d198187ca83d8a5940ad8d7122a45df3" dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", + "gix-hash 0.10.4", + "gix-hashtable", + "gix-object", + "thiserror", +] + +[[package]] +name = "gix-url" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a22b4b32ad14d68f7b7fb6458fa58d44b01797d94c1b8f4db2d9c7b3c366b5" +dependencies = [ + "bstr", + "gix-features 0.28.1", + "gix-path", + "home", + "thiserror", + "url", +] + +[[package]] +name = "gix-utils" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" +dependencies = [ + "fastrand", +] + +[[package]] +name = "gix-validate" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-worktree" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ec9a000b4f24af706c3cc680c7cda235656cbe3216336522f5692773b8a301" +dependencies = [ + "bstr", + "gix-attributes", + "gix-features 0.28.1", + "gix-glob", + "gix-hash 0.10.4", + "gix-index", + "gix-object", + "gix-path", + "io-close", + "thiserror", ] [[package]] @@ -1352,7 +1888,7 @@ dependencies = [ "gpg-error", "gpgme-sys", "libc", - "memoffset", + "memoffset 0.7.1", "once_cell", "smallvec", "static_assertions", @@ -1368,7 +1904,7 @@ dependencies = [ "libc", "libgpg-error-sys", "system-deps", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -1378,15 +1914,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] [[package]] name = "h2" -version = "0.3.18" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1394,7 +1930,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.2", + "indexmap", "slab", "tokio", "tokio-util", @@ -1406,32 +1942,30 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.14.2", ] [[package]] @@ -1451,12 +1985,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1464,6 +1995,57 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand", + "ring 0.16.20", + "rustls 0.21.9", + "rustls-pemfile", + "thiserror", + "tinyvec", + "tokio", + "tokio-rustls", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "rustls 0.21.9", + "smallvec", + "thiserror", + "tokio", + "tokio-rustls", + "tracing", +] + [[package]] name = "himalaya" version = "0.9.0" @@ -1478,7 +2060,7 @@ dependencies = [ "console", "coredump", "dialoguer", - "dirs", + "dirs 4.0.0", "email-lib", "email_address", "env_logger", @@ -1487,21 +2069,21 @@ dependencies = [ "keyring-lib", "log", "md5", - "mml-lib", - "oauth-lib", + "mml-lib 1.0.1", + "oauth-lib 0.1.0", "once_cell", "process-lib", "rusqlite", "secret-lib", "serde", "serde_json", - "shellexpand-utils", + "shellexpand-utils 0.1.0", "tempfile", "termcolor", "terminal_size", "tokio", - "toml", - "toml_edit", + "toml 0.7.8", + "toml_edit 0.19.15", "unicode-width", "url", "uuid", @@ -1522,7 +2104,16 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", ] [[package]] @@ -1538,9 +2129,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1566,9 +2157,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -1578,9 +2169,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1593,7 +2184,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1602,55 +2193,41 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" -dependencies = [ - "http", - "hyper", - "rustls 0.20.8", - "tokio", - "tokio-rustls 0.23.4", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", "hyper", "log", - "rustls 0.21.1", + "rustls 0.21.9", "rustls-native-certs", "tokio", - "tokio-rustls 0.24.0", + "tokio-rustls", ] [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows-core", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -1670,20 +2247,19 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1695,7 +2271,7 @@ version = "3.0.0-alpha.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cceec1222cd3c9b196695fe296dc6ddaa617e06b0c49742140ff9bbc87af628" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", "bufstream", "chrono", "imap-proto", @@ -1716,32 +2292,33 @@ dependencies = [ ] [[package]] -name = "indexmap" -version = "1.9.2" +name = "imara-diff" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" dependencies = [ - "autocfg", + "ahash", "hashbrown 0.12.3", ] [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", + "instant", "number_prefix", "portable-atomic", "unicode-width", @@ -1766,65 +2343,53 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.3" +name = "io-close" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" dependencies = [ "libc", - "windows-sys 0.42.0", + "winapi", ] [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.5", "widestring", - "winapi", - "winreg", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] name = "ipnet" -version = "2.7.2" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" - -[[package]] -name = "is-terminal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" -dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes", - "rustix", - "windows-sys 0.42.0", -] +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1840,9 +2405,9 @@ dependencies = [ [[package]] name = "keyring" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ac4b8b0884cdf23c4619d139acf43839eac4f0739b92980c2a6d460d9c84f5" +checksum = "9549a129bd08149e0a71b2d1ce2729780d47127991bfd0a78cc1df697ec72492" dependencies = [ "byteorder", "lazy_static", @@ -1868,14 +2433,14 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.137" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libgpg-error-sys" @@ -1885,14 +2450,25 @@ checksum = "c97079310f39c835d3bd73578379d040f779614bb331c7ffbb6630fee6420290" dependencies = [ "build-rs", "system-deps", - "winreg", + "winreg 0.10.1", ] [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] [[package]] name = "libsqlite3-sys" @@ -1905,15 +2481,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "link-cplusplus" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1932,15 +2499,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1948,12 +2515,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru-cache" @@ -1966,48 +2530,48 @@ dependencies = [ [[package]] name = "mail-auth" -version = "0.3.2" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b0969bac270a60560d3a6f89c812b3e39b2f4b3ca8d866063f482030d14f19" +checksum = "ab6524549b92c6f1250ddefe10f67bcedb9de0674a026b21e88dc1958437f8a6" dependencies = [ - "ahash 0.8.3", + "ahash", "flate2", + "hickory-resolver", "lru-cache", "mail-builder", "mail-parser", "parking_lot", "quick-xml", - "ring", + "ring 0.17.5", "rustls-pemfile", "serde", "serde_json", - "trust-dns-resolver", "zip", ] [[package]] name = "mail-builder" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765969f4385f88a62738e8ed63e2fa630571d7ed6fd96ca6932d699513dd8c28" +checksum = "ef70f53409852d2612f2249810cbbe0c9931ca25b739b734bafc7f61d88051d4" dependencies = [ "gethostname", ] [[package]] name = "mail-parser" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4158a1c18963244e083888b21465846dfb68d6170850ed1ab4742edd57c9d47" +checksum = "0e51d275d90a41584d12ea25fc4a7d7d00236a4718308b994ed13a7ff90a6985" dependencies = [ "encoding_rs", ] [[package]] name = "mail-send" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d2b8d0cb56f199d36f527ff96453cf3b1cdfdacb5e4d154ac1d8fcd89873c2" +checksum = "4cbc58a799366b3b2956a2c5ae7e2892ea34b3016343cbbdc5deb844aa6c0973" dependencies = [ "base64 0.20.0", "gethostname", @@ -2015,11 +2579,11 @@ dependencies = [ "mail-builder", "md5", "rand", - "rustls 0.21.1", + "rustls 0.21.9", "smtp-proto", "tokio", - "tokio-rustls 0.24.0", - "webpki-roots 0.23.1", + "tokio-rustls", + "webpki-roots", ] [[package]] @@ -2039,19 +2603,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "digest 0.10.6", + "cfg-if", + "digest", ] [[package]] @@ -2062,9 +2621,18 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] [[package]] name = "memoffset" @@ -2076,10 +2644,19 @@ dependencies = [ ] [[package]] -name = "mime" -version = "0.3.16" +name = "memoffset" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -2098,24 +2675,38 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "wasi", + "windows-sys 0.48.0", ] [[package]] name = "mml-lib" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0041c291179f654d5e256a8473415dfea8fc055e8c51358a3c99dac2cf9e" +version = "1.0.1" dependencies = [ "async-recursion", - "chumsky 1.0.0-alpha.4", + "chumsky", + "log", + "mail-builder", + "mail-parser", + "nanohtml2text", + "shellexpand-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tree_magic_mini", +] + +[[package]] +name = "mml-lib" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915efb96feb76c123001341d1631dc06c9bbe14c1a249ef709cf84b341eb8295" +dependencies = [ + "async-recursion", + "chumsky", "gpgme", "keyring-lib", "log", @@ -2125,7 +2716,7 @@ dependencies = [ "pgp-lib", "process-lib", "secret-lib", - "shellexpand-utils", + "shellexpand-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "tree_magic_mini", ] @@ -2137,10 +2728,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999681fe3c0524336e98ece1c25ee4278607f25cc1e361ad0f9201c8bf56dc2c" [[package]] -name = "nom" -version = "7.1.1" +name = "nix" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -2176,13 +2778,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", ] [[package]] @@ -2208,9 +2810,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2218,11 +2820,20 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.3", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ - "hermit-abi 0.2.6", "libc", ] @@ -2232,6 +2843,18 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "oauth-lib" +version = "0.1.0" +dependencies = [ + "log", + "oauth2", + "reqwest", + "thiserror", + "tokio", + "url", +] + [[package]] name = "oauth-lib" version = "0.1.0" @@ -2248,13 +2871,13 @@ dependencies = [ [[package]] name = "oauth2" -version = "4.3.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaf26a72311c087f8c5ba617c96fac67a5c04f430e716ac8d8ab2de62e23368" +checksum = "c38841cdd844847e3e7c8d29cef9dcfed8877f8f56f9071f77843ecf3baf937f" dependencies = [ "base64 0.13.1", "chrono", - "getrandom 0.2.8", + "getrandom", "http", "rand", "reqwest", @@ -2267,10 +2890,19 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.16.0" +name = "object" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl-probe" @@ -2279,19 +2911,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "os_str_bytes" -version = "6.4.1" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" dependencies = [ "memchr", ] [[package]] name = "ouroboros" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbb50b356159620db6ac971c6d5c9ab788c9cc38a6f49619fca2a27acb062ca" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" dependencies = [ "aliasable", "ouroboros_macro", @@ -2299,15 +2937,15 @@ dependencies = [ [[package]] name = "ouroboros_macro" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.104", + "syn 1.0.109", ] [[package]] @@ -2346,15 +2984,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", - "windows-sys 0.42.0", + "windows-targets 0.48.5", ] [[package]] @@ -2364,7 +3002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2374,7 +3012,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest", "hmac", "password-hash", "sha2", @@ -2391,9 +3029,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -2402,17 +3040,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap", ] [[package]] name = "pgp" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a79d6411154d1a9908e7a2c4bac60a5742f6125823c2c30780c7039aef02f0" +checksum = "27e1f8e085bfa9b85763fe3ddaacbe90a09cd847b3833129153a6cb063bbe132" dependencies = [ "aes", - "base64 0.21.0", + "base64 0.21.5", "bitfield", "block-padding", "blowfish", @@ -2425,9 +3063,10 @@ dependencies = [ "chrono", "cipher", "crc24", + "curve25519-dalek", "derive_builder", "des", - "digest 0.10.6", + "digest", "ed25519-dalek", "elliptic-curve", "flate2", @@ -2465,7 +3104,7 @@ dependencies = [ "async-recursion", "futures", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls", "log", "pgp", "rand", @@ -2479,9 +3118,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2512,21 +3151,27 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.0.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "portable-atomic" -version = "0.3.19" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -2536,9 +3181,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primeorder" -version = "0.13.2" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] @@ -2552,7 +3197,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.104", + "syn 1.0.109", "version_check", ] @@ -2567,17 +3212,11 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2593,6 +3232,12 @@ dependencies = [ "tokio", ] +[[package]] +name = "prodash" +version = "23.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9516b775656bc3e8985e19cd4b8c0c0de045095074e453d2c0a513b5f978392d" + [[package]] name = "psm" version = "0.1.21" @@ -2610,28 +3255,22 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] -[[package]] -name = "quoted_printable" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f14e071918cbeefc5edc986a7aa92c425dae244e003a35e1cdddb5ca39b5cb" - [[package]] name = "rand" version = "0.8.5" @@ -2640,7 +3279,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -2650,16 +3289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -2668,14 +3298,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom", ] [[package]] name = "rayon" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -2683,75 +3313,96 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.8.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" - -[[package]] -name = "regex-syntax" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ - "winapi", + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", ] [[package]] -name = "reqwest" -version = "0.11.17" +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ - "base64 0.21.0", + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -2760,7 +3411,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "ipnet", "js-sys", "log", @@ -2768,20 +3419,21 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.20.8", + "rustls 0.21.9", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.22.6", - "winreg", + "webpki-roots", + "winreg 0.50.0", ] [[package]] @@ -2794,20 +3446,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc2047-decoder" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11347d014ae34e1d367aaf9191c37bf071b161e2e1c09c8559c7717e87030e11" -dependencies = [ - "base64 0.13.1", - "charset", - "chumsky 0.8.0", - "memchr", - "quoted_printable", - "thiserror", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -2827,19 +3465,33 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "ripemd" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.6", + "digest", ] [[package]] @@ -2850,21 +3502,20 @@ checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" [[package]] name = "rsa" -version = "0.9.0-pre.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65db0998ad35adcaca498b7358992e088ee16cc783fe6fb899da203e113a63e5" +checksum = "6a3211b01eea83d80687da9eef70e39d65144a3894866a5153a2723e425a157f" dependencies = [ - "byteorder", "const-oid", - "digest 0.10.6", + "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8", - "rand_core 0.6.4", + "rand_core", "signature", + "spki", "subtle", "zeroize", ] @@ -2875,7 +3526,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.4.1", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -2883,6 +3534,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc_version" version = "0.4.0" @@ -2894,38 +3551,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.5" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] [[package]] name = "rustls" -version = "0.21.1" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", - "ring", + "ring 0.17.5", "rustls-webpki", "sct", ] @@ -2937,16 +3593,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6a18f8d10f71bce9bca6eaeb80429460e652f3bcf0381f0c5f8954abf7b3b8" dependencies = [ "log", - "rustls 0.20.8", + "rustls 0.20.9", "rustls-native-certs", "webpki", ] [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -2956,28 +3612,34 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", ] [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] -name = "ryu" -version = "1.0.11" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safemem" @@ -2986,35 +3648,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] -name = "schannel" -version = "0.1.20" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -3045,9 +3709,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3058,9 +3722,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3068,35 +3732,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.160" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -3105,18 +3769,19 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" dependencies = [ + "itoa", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -3135,24 +3800,30 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest", ] [[package]] -name = "sha2" -version = "0.10.6" +name = "sha1_smol" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest", ] [[package]] @@ -3161,10 +3832,16 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest", "keccak", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shellexpand" version = "3.1.0" @@ -3172,10 +3849,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" dependencies = [ "bstr", - "dirs", + "dirs 5.0.1", "os_str_bytes", ] +[[package]] +name = "shellexpand-utils" +version = "0.1.0" +dependencies = [ + "log", + "shellexpand", + "thiserror", +] + [[package]] name = "shellexpand-utils" version = "0.1.0" @@ -3187,6 +3873,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3198,28 +3894,28 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.6", - "rand_core 0.6.4", + "digest", + "rand_core", ] [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smtp-proto" @@ -3229,20 +3925,36 @@ checksum = "d4b756ac662e92a0e5b360349bea5f0b0784d4be4541eff2972049dfdfd7f862" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.2" @@ -3286,15 +3998,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.104" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -3303,53 +4015,73 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-deps" -version = "6.1.1" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml", + "toml 0.8.8", "version-compare", ] [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "redox_syscall 0.4.1", + "rustix", + "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -3366,58 +4098,53 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "time" -version = "0.1.45" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", + "itoa", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" -dependencies = [ + "num_threads", + "powerfmt", "serde", "time-core", + "time-macros", ] [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] -name = "tiny-keccak" -version = "2.0.2" +name = "time-macros" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ - "crunchy", + "time-core", ] [[package]] @@ -3431,66 +4158,54 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.8", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" -dependencies = [ - "rustls 0.21.1", + "rustls 0.21.9", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -3502,32 +4217,57 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.4" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.9" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 1.9.2", + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -3542,11 +4282,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3554,20 +4293,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -3586,59 +4325,6 @@ dependencies = [ "petgraph", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "ring", - "rustls 0.20.8", - "rustls-pemfile", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tokio-rustls 0.23.4", - "tracing", - "url", - "webpki", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "lru-cache", - "parking_lot", - "resolv-conf", - "rustls 0.20.8", - "smallvec", - "thiserror", - "tokio", - "tokio-rustls 0.23.4", - "tracing", - "trust-dns-proto", - "webpki-roots 0.22.6", -] - [[package]] name = "try-lock" version = "0.2.4" @@ -3656,9 +4342,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" @@ -3667,10 +4353,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] -name = "unicode-ident" -version = "1.0.5" +name = "unicode-bom" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "63ec69f541d875b783ca40184d655f2927c95f0bffd486faa83cd3ac3529ec32" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -3683,9 +4375,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "untrusted" @@ -3694,22 +4386,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] -name = "url" -version = "2.4.0" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", "serde", ] [[package]] name = "urlencoding" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf7-imap" @@ -3722,13 +4420,19 @@ dependencies = [ "regex", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.8", + "getrandom", ] [[package]] @@ -3737,6 +4441,18 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "vergen" +version = "8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b86a8af1dedf089b1c78338678e4c7492b6045649042d94faf19690499d236" +dependencies = [ + "anyhow", + "gix", + "rustversion", + "time", +] + [[package]] name = "version-compare" version = "0.1.1" @@ -3750,26 +4466,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "want" -version = "0.3.0" +name = "walkdir" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ - "log", - "try-lock", + "same-file", + "winapi-util", ] [[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] [[package]] name = "wasi" @@ -3779,9 +4492,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3789,24 +4502,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -3816,9 +4529,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3826,28 +4539,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -3855,37 +4568,25 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki", -] +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -3905,9 +4606,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -3924,43 +4625,72 @@ version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", "windows_i686_gnu 0.42.2", "windows_i686_msvc 0.42.2", "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.2", "windows_x86_64_msvc 0.42.2", ] [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows_aarch64_gnullvm", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", "windows_i686_gnu 0.42.2", "windows_i686_msvc 0.42.2", "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.2", "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3968,10 +4698,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +name = "windows_aarch64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -3980,10 +4710,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] -name = "windows_i686_gnu" -version = "0.36.1" +name = "windows_aarch64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -3992,10 +4722,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] -name = "windows_i686_msvc" -version = "0.36.1" +name = "windows_i686_gnu" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -4004,10 +4734,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" +name = "windows_i686_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -4015,6 +4745,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -4022,10 +4758,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -4034,10 +4770,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] -name = "winnow" -version = "0.4.6" +name = "windows_x86_64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -4052,27 +4794,58 @@ dependencies = [ ] [[package]] -name = "x25519-dalek" -version = "2.0.0-pre.1" +name = "winreg" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "curve25519-dalek 3.2.0", - "rand_core 0.6.4", + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek", + "rand_core", + "serde", "zeroize", ] [[package]] name = "z-base-32" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e897c250a7dfbb7002a324817f2540ab789a8f32d505032ca623a4109245e87" +checksum = "80a0d98613370af88e15bd2047702d7c78c8c6aba44403eb227c8ad706871f92" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "zeroize" -version = "1.5.7" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -4085,7 +4858,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -4104,7 +4877,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1", - "time 0.3.21", + "time", "zstd", ] @@ -4129,11 +4902,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 2a6eb22..e8f25e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,9 @@ version = "3.3" [dependencies.anyhow] version = "1.0" +[dependencies.async-trait] +version = "0.1" + [dependencies.atty] version = "0.2" @@ -88,21 +91,23 @@ version = "0.7.0" version = "1.16.0" [dependencies.email-lib] -version = "=0.15.3" +# version = "=0.15.3" default-features = false +path = "/home/soywod/sourcehut/pimalaya/email" [dependencies.keyring-lib] version = "=0.1.0" [dependencies.oauth-lib] -version = "=0.1.0" +# version = "=0.1.0" +path = "/home/soywod/sourcehut/pimalaya/oauth" [dependencies.process-lib] version = "=0.1.0" [dependencies.mml-lib] -version = "=0.5.0" -default-features = false +# version = "=1.0.1" +path = "/home/soywod/sourcehut/pimalaya/mml" [dependencies.secret-lib] version = "=0.1.0" @@ -115,7 +120,8 @@ features = ["derive"] version = "1.0" [dependencies.shellexpand-utils] -version = "=0.1.0" +# version = "=0.1.0" +path = "/home/soywod/sourcehut/pimalaya/shellexpand-utils" [dependencies.termcolor] version = "1.1" diff --git a/config.sample.toml b/config.sample.toml index 0b24037..2fd521c 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -1,54 +1,18 @@ -display-name = "Display NAME" -signature-delim = "~~" -signature = "~/.signature" -downloads-dir = "~/downloads" -folder-listing-page-size = 12 -email-listing-page-size = 12 -email-reading-headers = ["From", "To"] -email-reading-verify-cmd = "gpg --verify -q" -email-reading-decrypt-cmd = "gpg -dq" -email-writing-sign-cmd = "gpg -o - -saq" -email-writing-encrypt-cmd = "gpg -o - -eqar " - [example] default = true -display-name = "Display NAME (gmail)" -email = "display.name@gmail.local" +# The display-name and email are used to build the full email address: +# "My example account" +display-name = "My example account" +email = "example@localhost" + +# The default backend used for all the features like adding folders, +# listing envelopes or copying messages. backend = "imap" -imap-host = "imap.gmail.com" -imap-login = "display.name@gmail.local" -imap-auth = "passwd" -imap-passwd.cmd = "pass show gmail" -imap-port = 993 -imap-ssl = true -imap-starttls = false -imap-notify-cmd = """📫 "" """"" -imap-notify-query = "NOT SEEN" -imap-watch-cmds = ["echo \"received server changes!\""] -sender = "smtp" -smtp-host = "smtp.gmail.com" -smtp-login = "display.name@gmail.local" -smtp-auth = "passwd" -smtp-passwd.cmd = "pass show piana/gmail" -smtp-port = 465 -smtp-ssl = true -smtp-starttls = false +imap.host = "imap.gmail.com" +imap.port = 993 +imap.login = "example@localhost" +imap.auth = "passwd" +# imap.Some.passwd.cmd = "pass show gmail" -sync = true -sync-dir = "/tmp/sync/gmail" -sync-folders-strategy.include = ["INBOX"] - -[example.folder-aliases] -inbox = "INBOX" -drafts = "[Gmail]/Drafts" -sent = "[Gmail]/Sent Mail" -trash = "[Gmail]/Trash" - -[example.email-hooks] -pre-send = "echo $1" - -[example.email-reading-format] -type = "fixed" -width = 64 diff --git a/src/backend.rs b/src/backend.rs new file mode 100644 index 0000000..67d1882 --- /dev/null +++ b/src/backend.rs @@ -0,0 +1,237 @@ +use std::{collections::HashMap, ops::Deref}; + +use anyhow::{anyhow, Result}; +use async_trait::async_trait; + +#[cfg(feature = "imap-backend")] +use email::imap::{ImapSessionBuilder, ImapSessionSync}; +#[cfg(feature = "smtp-sender")] +use email::smtp::{SmtpClientBuilder, SmtpClientSync}; +use email::{ + account::AccountConfig, + config::Config, + folder::list::{imap::ListFoldersImap, maildir::ListFoldersMaildir}, + maildir::{MaildirSessionBuilder, MaildirSessionSync}, + sendmail::SendmailContext, +}; +use serde::{Deserialize, Serialize}; + +use crate::config::DeserializedConfig; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub enum BackendKind { + #[default] + None, + Maildir, + #[cfg(feature = "imap-backend")] + Imap, + #[cfg(feature = "notmuch-backend")] + Notmuch, + #[cfg(feature = "smtp-sender")] + Smtp, + Sendmail, +} + +#[derive(Clone, Default)] +pub struct BackendContextBuilder { + account_config: AccountConfig, + + #[cfg(feature = "imap-backend")] + imap: Option, + maildir: Option, + #[cfg(feature = "smtp-sender")] + smtp: Option, + sendmail: Option, +} + +#[async_trait] +impl email::backend::BackendContextBuilder for BackendContextBuilder { + type Context = BackendContext; + + async fn build(self) -> Result { + let mut ctx = BackendContext::default(); + + if let Some(maildir) = self.maildir { + ctx.maildir = Some(maildir.build().await?); + } + + #[cfg(feature = "imap-backend")] + if let Some(imap) = self.imap { + ctx.imap = Some(imap.build().await?); + } + + #[cfg(feature = "notmuch-backend")] + if let Some(notmuch) = self.notmuch { + ctx.notmuch = Some(notmuch.build().await?); + } + + #[cfg(feature = "smtp-sender")] + if let Some(smtp) = self.smtp { + ctx.smtp = Some(smtp.build().await?); + } + + if let Some(sendmail) = self.sendmail { + ctx.sendmail = Some(sendmail.build().await?); + } + + Ok(ctx) + } +} + +#[derive(Default)] +pub struct BackendContext { + #[cfg(feature = "imap-backend")] + pub imap: Option, + pub maildir: Option, + #[cfg(feature = "smtp-sender")] + pub smtp: Option, + pub sendmail: Option, +} + +pub struct BackendBuilder(pub email::backend::BackendBuilder); + +impl BackendBuilder { + pub async fn new(config: DeserializedConfig, account_name: Option<&str>) -> Result { + let (account_name, deserialized_account_config) = match account_name { + Some("default") | Some("") | None => config + .accounts + .iter() + .find_map(|(name, account)| { + account + .default + .filter(|default| *default == true) + .map(|_| (name.to_owned(), account.clone())) + }) + .ok_or_else(|| anyhow!("cannot find default account")), + Some(name) => config + .accounts + .get(name) + .map(|account| (name.to_owned(), account.clone())) + .ok_or_else(|| anyhow!("cannot find account {name}")), + }?; + + let config = Config { + display_name: config.display_name, + signature_delim: config.signature_delim, + signature: config.signature, + downloads_dir: config.downloads_dir, + + folder_listing_page_size: config.folder_listing_page_size, + folder_aliases: config.folder_aliases, + + email_listing_page_size: config.email_listing_page_size, + email_listing_datetime_fmt: config.email_listing_datetime_fmt, + email_listing_datetime_local_tz: config.email_listing_datetime_local_tz, + email_reading_headers: config.email_reading_headers, + email_reading_format: config.email_reading_format, + email_writing_headers: config.email_writing_headers, + email_sending_save_copy: config.email_sending_save_copy, + email_hooks: config.email_hooks, + + accounts: HashMap::from_iter(config.accounts.clone().into_iter().map( + |(name, config)| { + ( + name.clone(), + AccountConfig { + name, + email: config.email, + display_name: config.display_name, + signature_delim: config.signature_delim, + signature: config.signature, + downloads_dir: config.downloads_dir, + + folder_listing_page_size: config.folder_listing_page_size, + folder_aliases: config.folder_aliases.unwrap_or_default(), + + email_listing_page_size: config.email_listing_page_size, + email_listing_datetime_fmt: config.email_listing_datetime_fmt, + email_listing_datetime_local_tz: config.email_listing_datetime_local_tz, + + email_reading_headers: config.email_reading_headers, + email_reading_format: config.email_reading_format.unwrap_or_default(), + email_writing_headers: config.email_writing_headers, + email_sending_save_copy: config.email_sending_save_copy, + email_hooks: config.email_hooks.unwrap_or_default(), + + sync: config.sync, + sync_dir: config.sync_dir, + sync_folders_strategy: config.sync_folders_strategy.unwrap_or_default(), + + #[cfg(feature = "pgp")] + pgp: config.pgp, + }, + ) + }, + )), + }; + + let account_config = config.account(account_name)?; + + let backend_ctx_builder = BackendContextBuilder { + account_config: account_config.clone(), + maildir: deserialized_account_config + .maildir + .as_ref() + .map(|mdir_config| { + MaildirSessionBuilder::new(account_config.clone(), mdir_config.clone()) + }), + #[cfg(feature = "imap-backend")] + imap: deserialized_account_config + .imap + .as_ref() + .map(|imap_config| { + ImapSessionBuilder::new(account_config.clone(), imap_config.clone()) + }), + #[cfg(feature = "smtp-sender")] + smtp: deserialized_account_config + .smtp + .as_ref() + .map(|smtp_config| { + SmtpClientBuilder::new(account_config.clone(), smtp_config.clone()) + }), + sendmail: deserialized_account_config + .sendmail + .as_ref() + .map(|sendmail_config| { + SendmailContext::new(account_config.clone(), sendmail_config.clone()) + }), + ..Default::default() + }; + + let backend_builder = + email::backend::BackendBuilder::new(account_config.clone(), backend_ctx_builder) + .with_list_folders(move |ctx| { + println!( + "deserialized_account_config: {:#?}", + deserialized_account_config + ); + match deserialized_account_config.backend { + BackendKind::Maildir if ctx.maildir.is_some() => { + ListFoldersMaildir::new(ctx.maildir.as_ref().unwrap()) + } + #[cfg(feature = "imap-backend")] + BackendKind::Imap if ctx.imap.is_some() => { + ListFoldersImap::new(ctx.imap.as_ref().unwrap()) + } + #[cfg(feature = "notmuch-backend")] + BackendKind::Notmuch if ctx.notmuch.is_some() => { + ListFoldersNotmuch::new(ctx.notmuch.as_ref().unwrap()) + } + _ => None, + } + }); + + Ok(Self(backend_builder)) + } +} + +impl Deref for BackendBuilder { + type Target = email::backend::BackendBuilder; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +pub type Backend = email::backend::Backend; diff --git a/src/cache/id_mapper.rs b/src/cache/id_mapper.rs index 5533a4e..a022640 100644 --- a/src/cache/id_mapper.rs +++ b/src/cache/id_mapper.rs @@ -1,15 +1,12 @@ use anyhow::{anyhow, Context, Result}; -#[cfg(feature = "imap-backend")] -use email::backend::ImapBackend; +use email::account::AccountConfig; #[cfg(feature = "notmuch-backend")] use email::backend::NotmuchBackend; -use email::{ - account::AccountConfig, - backend::{Backend, MaildirBackend}, -}; use log::{debug, trace}; use std::path::{Path, PathBuf}; +use crate::backend::Backend; + const ID_MAPPER_DB_FILE_NAME: &str = ".id-mapper.sqlite"; #[derive(Debug)] @@ -39,47 +36,45 @@ impl IdMapper { db_path } - pub fn new( - backend: &dyn Backend, - account_config: &AccountConfig, - folder: &str, - ) -> Result { - #[cfg(feature = "imap-backend")] - if backend.as_any().is::() { - return Ok(IdMapper::Dummy); - } + pub fn new(backend: &Backend, account_config: &AccountConfig, folder: &str) -> Result { + Ok(IdMapper::Dummy) - let mut db_path = PathBuf::new(); + // #[cfg(feature = "imap-backend")] + // if backend.as_any().is::() { + // return Ok(IdMapper::Dummy); + // } - if let Some(backend) = backend.as_any().downcast_ref::() { - db_path = Self::find_closest_db_path(backend.path()) - } + // let mut db_path = PathBuf::new(); - #[cfg(feature = "notmuch-backend")] - if let Some(backend) = backend.as_any().downcast_ref::() { - db_path = Self::find_closest_db_path(backend.path()) - } + // if let Some(backend) = backend.as_any().downcast_ref::() { + // db_path = Self::find_closest_db_path(backend.path()) + // } - let folder = account_config.get_folder_alias(folder)?; - let digest = md5::compute(account_config.name.clone() + &folder); - let table = format!("id_mapper_{digest:x}"); - debug!("creating id mapper table {table} at {db_path:?}…"); + // #[cfg(feature = "notmuch-backend")] + // if let Some(backend) = backend.as_any().downcast_ref::() { + // db_path = Self::find_closest_db_path(backend.path()) + // } - let conn = rusqlite::Connection::open(&db_path) - .with_context(|| format!("cannot open id mapper database at {db_path:?}"))?; + // let folder = account_config.get_folder_alias(folder)?; + // let digest = md5::compute(account_config.name.clone() + &folder); + // let table = format!("id_mapper_{digest:x}"); + // debug!("creating id mapper table {table} at {db_path:?}…"); - let query = format!( - "CREATE TABLE IF NOT EXISTS {table} ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - internal_id TEXT UNIQUE - )", - ); - trace!("create table query: {query:#?}"); + // let conn = rusqlite::Connection::open(&db_path) + // .with_context(|| format!("cannot open id mapper database at {db_path:?}"))?; - conn.execute(&query, []) - .context("cannot create id mapper table")?; + // let query = format!( + // "CREATE TABLE IF NOT EXISTS {table} ( + // id INTEGER PRIMARY KEY AUTOINCREMENT, + // internal_id TEXT UNIQUE + // )", + // ); + // trace!("create table query: {query:#?}"); - Ok(Self::Mapper(table, conn)) + // conn.execute(&query, []) + // .context("cannot create id mapper table")?; + + // Ok(Self::Mapper(table, conn)) } pub fn create_alias(&self, id: I) -> Result diff --git a/src/config/config.rs b/src/config/config.rs index b36a9b2..4ece9b8 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -6,12 +6,8 @@ use anyhow::{anyhow, Context, Result}; use dialoguer::Confirm; use dirs::{config_dir, home_dir}; -use email::{ - account::AccountConfig, - email::{EmailHooks, EmailTextPlainFormat}, -}; +use email::email::{EmailHooks, EmailTextPlainFormat}; use log::{debug, trace}; -use process::Cmd; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fs, path::PathBuf, process::exit}; use toml; @@ -39,44 +35,12 @@ pub struct DeserializedConfig { pub email_listing_datetime_fmt: Option, pub email_listing_datetime_local_tz: Option, pub email_reading_headers: Option>, - #[serde( - default, - with = "EmailTextPlainFormatDef", - skip_serializing_if = "EmailTextPlainFormat::is_default" - )] - pub email_reading_format: EmailTextPlainFormat, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_reading_verify_cmd: Option, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_reading_decrypt_cmd: Option, + #[serde(default, with = "OptionEmailTextPlainFormatDef")] + pub email_reading_format: Option, pub email_writing_headers: Option>, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_writing_sign_cmd: Option, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_writing_encrypt_cmd: Option, pub email_sending_save_copy: Option, - #[serde( - default, - with = "EmailHooksDef", - skip_serializing_if = "EmailHooks::is_empty" - )] - pub email_hooks: EmailHooks, + #[serde(default, with = "OptionEmailHooksDef")] + pub email_hooks: Option, #[serde(flatten)] pub accounts: HashMap, @@ -134,28 +98,6 @@ impl DeserializedConfig { .or_else(|| home_dir().map(|p| p.join(".himalayarc"))) .filter(|p| p.exists()) } - - pub fn to_account_config(&self, account_name: Option<&str>) -> Result { - let (account_name, deserialized_account_config) = match account_name { - Some("default") | Some("") | None => self - .accounts - .iter() - .find_map(|(name, account)| { - account - .default - .filter(|default| *default == true) - .map(|_| (name.clone(), account)) - }) - .ok_or_else(|| anyhow!("cannot find default account")), - Some(name) => self - .accounts - .get(name) - .map(|account| (name.to_string(), account)) - .ok_or_else(|| anyhow!(format!("cannot find account {}", name))), - }?; - - Ok(deserialized_account_config.to_account_config(account_name, self)) - } } #[cfg(test)] diff --git a/src/config/prelude.rs b/src/config/prelude.rs index 1e5f783..861fb0a 100644 --- a/src/config/prelude.rs +++ b/src/config/prelude.rs @@ -9,15 +9,15 @@ use email::account::{NativePgpConfig, NativePgpSecretKey, SignedSecretKey}; #[cfg(feature = "notmuch-backend")] use email::backend::NotmuchConfig; #[cfg(feature = "imap-backend")] -use email::backend::{ImapAuthConfig, ImapConfig}; +use email::imap::{ImapAuthConfig, ImapConfig}; #[cfg(feature = "smtp-sender")] -use email::sender::{SmtpAuthConfig, SmtpConfig}; +use email::smtp::{SmtpAuthConfig, SmtpConfig}; use email::{ account::{OAuth2Config, OAuth2Method, OAuth2Scopes, PasswdConfig}, - backend::{BackendConfig, MaildirConfig}, email::{EmailHooks, EmailTextPlainFormat}, folder::sync::FolderSyncStrategy, - sender::{SenderConfig, SendmailConfig}, + maildir::MaildirConfig, + sendmail::SendmailConfig, }; use keyring::Entry; use process::{Cmd, Pipeline, SingleCmd}; @@ -108,49 +108,47 @@ pub enum OAuth2MethodDef { } #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BackendConfig", tag = "backend", rename_all = "kebab-case")] -pub enum BackendConfigDef { - #[default] - None, - #[cfg(feature = "imap-backend")] - #[serde(with = "ImapConfigDef")] - Imap(ImapConfig), - #[serde(with = "MaildirConfigDef")] - Maildir(MaildirConfig), - #[cfg(feature = "notmuch-backend")] - #[serde(with = "NotmuchConfigDef")] - Notmuch(NotmuchConfig), +#[serde(remote = "Option", from = "OptionImapConfig")] +pub struct OptionImapConfigDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +pub struct OptionImapConfig { + #[serde(default, skip)] + is_none: bool, + #[serde(flatten, with = "ImapConfigDef")] + inner: ImapConfig, +} + +impl From for Option { + fn from(config: OptionImapConfig) -> Option { + if config.is_none { + None + } else { + Some(config.inner) + } + } } #[cfg(feature = "imap-backend")] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImapConfig")] +#[serde(remote = "ImapConfig", rename_all = "kebab-case")] pub struct ImapConfigDef { - #[serde(rename = "imap-host")] pub host: String, - #[serde(rename = "imap-port")] pub port: u16, - #[serde(rename = "imap-ssl")] pub ssl: Option, - #[serde(rename = "imap-starttls")] pub starttls: Option, - #[serde(rename = "imap-insecure")] pub insecure: Option, - #[serde(rename = "imap-login")] pub login: String, #[serde(flatten, with = "ImapAuthConfigDef")] pub auth: ImapAuthConfig, - #[serde(rename = "imap-notify-cmd")] pub notify_cmd: Option, - #[serde(rename = "imap-notify-query")] pub notify_query: Option, - #[serde(rename = "imap-watch-cmds")] pub watch_cmds: Option>, } #[cfg(feature = "imap-backend")] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImapAuthConfig", tag = "imap-auth")] +#[serde(remote = "ImapAuthConfig", tag = "auth")] pub enum ImapAuthConfigDef { #[serde(rename = "passwd", alias = "password", with = "ImapPasswdConfigDef")] Passwd(#[serde(default)] PasswdConfig), @@ -227,6 +225,28 @@ pub enum ImapOAuth2ScopesDef { Scopes(Vec), } +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Option", from = "OptionMaildirConfig")] +pub struct OptionMaildirConfigDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionMaildirConfig { + #[default] + #[serde(skip_serializing)] + None, + Some(#[serde(with = "MaildirConfigDef")] MaildirConfig), +} + +impl From for Option { + fn from(config: OptionMaildirConfig) -> Option { + match config { + OptionMaildirConfig::None => None, + OptionMaildirConfig::Some(config) => Some(config), + } + } +} + #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde(remote = "MaildirConfig", rename_all = "kebab-case")] pub struct MaildirConfigDef { @@ -234,6 +254,31 @@ pub struct MaildirConfigDef { pub root_dir: PathBuf, } +#[cfg(feature = "notmuch-backend")] +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Option", from = "OptionNotmuchConfig")] +pub struct OptionNotmuchConfigDef; + +#[cfg(feature = "notmuch-backend")] +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionNotmuchConfig { + #[default] + #[serde(skip_serializing)] + None, + Some(#[serde(with = "NotmuchConfigDef")] NotmuchConfig), +} + +#[cfg(feature = "notmuch-backend")] +impl From for Option { + fn from(config: OptionNotmuchConfig) -> Option { + match config { + OptionNotmuchConfig::None => None, + OptionNotmuchConfig::Some(config) => Some(config), + } + } +} + #[cfg(feature = "notmuch-backend")] #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde(remote = "NotmuchConfig", rename_all = "kebab-case")] @@ -242,6 +287,35 @@ pub struct NotmuchConfigDef { pub db_path: PathBuf, } +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde( + remote = "Option", + from = "OptionEmailTextPlainFormat" +)] +pub struct OptionEmailTextPlainFormatDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionEmailTextPlainFormat { + #[serde(skip_serializing)] + None, + #[default] + Auto, + Flowed, + Fixed(usize), +} + +impl From for Option { + fn from(fmt: OptionEmailTextPlainFormat) -> Option { + match fmt { + OptionEmailTextPlainFormat::None => None, + OptionEmailTextPlainFormat::Auto => Some(EmailTextPlainFormat::Auto), + OptionEmailTextPlainFormat::Flowed => Some(EmailTextPlainFormat::Flowed), + OptionEmailTextPlainFormat::Fixed(size) => Some(EmailTextPlainFormat::Fixed(size)), + } + } +} + #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde( remote = "EmailTextPlainFormat", @@ -257,15 +331,25 @@ pub enum EmailTextPlainFormatDef { } #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SenderConfig", tag = "sender", rename_all = "kebab-case")] -pub enum SenderConfigDef { +#[serde(remote = "Option", from = "OptionSmtpConfig")] +pub struct OptionSmtpConfigDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionSmtpConfig { #[default] + #[serde(skip_serializing)] None, - #[cfg(feature = "smtp-sender")] - #[serde(with = "SmtpConfigDef")] - Smtp(SmtpConfig), - #[serde(with = "SendmailConfigDef")] - Sendmail(SendmailConfig), + Some(#[serde(with = "SmtpConfigDef")] SmtpConfig), +} + +impl From for Option { + fn from(config: OptionSmtpConfig) -> Option { + match config { + OptionSmtpConfig::None => None, + OptionSmtpConfig::Some(config) => Some(config), + } + } } #[cfg(feature = "smtp-sender")] @@ -367,6 +451,28 @@ pub enum SmtpOAuth2ScopesDef { Scopes(Vec), } +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Option", from = "OptionSendmailConfig")] +pub struct OptionSendmailConfigDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionSendmailConfig { + #[default] + #[serde(skip_serializing)] + None, + Some(#[serde(with = "SendmailConfigDef")] SendmailConfig), +} + +impl From for Option { + fn from(config: OptionSendmailConfig) -> Option { + match config { + OptionSendmailConfig::None => None, + OptionSendmailConfig::Some(config) => Some(config), + } + } +} + #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(remote = "SendmailConfig", rename_all = "kebab-case")] pub struct SendmailConfigDef { @@ -382,6 +488,28 @@ fn sendmail_default_cmd() -> Cmd { Cmd::from("/usr/sbin/sendmail") } +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Option", from = "OptionEmailHooks")] +pub struct OptionEmailHooksDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionEmailHooks { + #[default] + #[serde(skip_serializing)] + None, + Some(#[serde(with = "EmailHooksDef")] EmailHooks), +} + +impl From for Option { + fn from(fmt: OptionEmailHooks) -> Option { + match fmt { + OptionEmailHooks::None => None, + OptionEmailHooks::Some(hooks) => Some(hooks), + } + } +} + /// Represents the email hooks. Useful for doing extra email /// processing before or after sending it. #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] @@ -392,6 +520,31 @@ pub struct EmailHooksDef { pub pre_send: Option, } +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde( + remote = "Option", + from = "OptionFolderSyncStrategy" +)] +pub struct OptionFolderSyncStrategyDef; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OptionFolderSyncStrategy { + #[default] + #[serde(skip_serializing)] + None, + Some(#[serde(with = "FolderSyncStrategyDef")] FolderSyncStrategy), +} + +impl From for Option { + fn from(config: OptionFolderSyncStrategy) -> Option { + match config { + OptionFolderSyncStrategy::None => None, + OptionFolderSyncStrategy::Some(config) => Some(config), + } + } +} + #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde(remote = "FolderSyncStrategy", rename_all = "kebab-case")] pub enum FolderSyncStrategyDef { diff --git a/src/domain/account/accounts.rs b/src/domain/account/accounts.rs index d752e00..c1e9665 100644 --- a/src/domain/account/accounts.rs +++ b/src/domain/account/accounts.rs @@ -5,7 +5,6 @@ //! accounts from the config file. use anyhow::Result; -use email::backend::BackendConfig; use serde::Serialize; use std::{collections::hash_map::Iter, ops::Deref}; @@ -40,19 +39,45 @@ impl PrintTable for Accounts { impl From> for Accounts { fn from(map: Iter<'_, String, DeserializedAccountConfig>) -> Self { let mut accounts: Vec<_> = map - .map(|(name, account)| match &account.backend { - BackendConfig::None => Account::new(name, "none", false), - BackendConfig::Maildir(_) => { - Account::new(name, "maildir", account.default.unwrap_or_default()) - } + .map(|(name, account)| { + let mut backends = String::new(); + #[cfg(feature = "imap-backend")] - BackendConfig::Imap(_) => { - Account::new(name, "imap", account.default.unwrap_or_default()) + if account.imap.is_some() { + backends.push_str("imap"); } + + if account.maildir.is_some() { + if !backends.is_empty() { + backends.push_str(", ") + } + backends.push_str("maildir"); + } + #[cfg(feature = "notmuch-backend")] - BackendConfig::Notmuch(_) => { - Account::new(name, "notmuch", account.default.unwrap_or_default()) + if account.imap.is_some() { + if !backends.is_empty() { + backends.push_str(", ") + } + backends.push_str("notmuch"); } + + #[cfg(feature = "smtp-sender")] + if account.smtp.is_some() { + if !backends.is_empty() { + backends.push_str(", ") + } + backends.push_str("smtp"); + } + + if account.sendmail.is_some() { + if !backends.is_empty() { + backends.push_str(", ") + } + backends.push_str("sendmail"); + } + + Account::new(name, &backends, account.default.unwrap_or_default()) }) .collect(); accounts.sort_by(|a, b| b.name.partial_cmp(&a.name).unwrap()); diff --git a/src/domain/account/config.rs b/src/domain/account/config.rs index 05017a8..e574f4c 100644 --- a/src/domain/account/config.rs +++ b/src/domain/account/config.rs @@ -6,29 +6,27 @@ #[cfg(feature = "pgp")] use email::account::PgpConfig; #[cfg(feature = "imap-backend")] -use email::backend::ImapAuthConfig; +use email::imap::ImapConfig; #[cfg(feature = "smtp-sender")] -use email::sender::SmtpAuthConfig; +use email::smtp::SmtpConfig; use email::{ - account::AccountConfig, - backend::BackendConfig, email::{EmailHooks, EmailTextPlainFormat}, folder::sync::FolderSyncStrategy, - sender::SenderConfig, + maildir::MaildirConfig, + sendmail::SendmailConfig, }; - -use process::Cmd; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, path::PathBuf}; -use crate::config::{prelude::*, DeserializedConfig}; +use crate::{backend::BackendKind, config::prelude::*}; /// Represents all existing kind of account config. #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)] #[serde(tag = "backend", rename_all = "kebab-case")] pub struct DeserializedAccountConfig { - pub email: String, pub default: Option, + + pub email: String, pub display_name: Option, pub signature_delim: Option, pub signature: Option, @@ -41,192 +39,39 @@ pub struct DeserializedAccountConfig { pub email_listing_datetime_fmt: Option, pub email_listing_datetime_local_tz: Option, pub email_reading_headers: Option>, - #[serde( - default, - with = "EmailTextPlainFormatDef", - skip_serializing_if = "EmailTextPlainFormat::is_default" - )] - pub email_reading_format: EmailTextPlainFormat, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_reading_verify_cmd: Option, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_reading_decrypt_cmd: Option, + #[serde(default, with = "OptionEmailTextPlainFormatDef")] + pub email_reading_format: Option, pub email_writing_headers: Option>, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_writing_sign_cmd: Option, - #[serde( - default, - with = "OptionCmdDef", - skip_serializing_if = "Option::is_none" - )] - pub email_writing_encrypt_cmd: Option, pub email_sending_save_copy: Option, - #[serde( - default, - with = "EmailHooksDef", - skip_serializing_if = "EmailHooks::is_empty" - )] - pub email_hooks: EmailHooks, + #[serde(default, with = "OptionEmailHooksDef")] + pub email_hooks: Option, pub sync: Option, pub sync_dir: Option, - #[serde( - default, - with = "FolderSyncStrategyDef", - skip_serializing_if = "FolderSyncStrategy::is_default" - )] - pub sync_folders_strategy: FolderSyncStrategy, + #[serde(default, with = "OptionFolderSyncStrategyDef")] + pub sync_folders_strategy: Option, - #[serde(flatten, with = "BackendConfigDef")] - pub backend: BackendConfig, - #[serde(flatten, with = "SenderConfigDef")] - pub sender: SenderConfig, + pub backend: BackendKind, + + #[cfg(feature = "imap-backend")] + #[serde(default, with = "OptionImapConfigDef")] + pub imap: Option, + + #[serde(default, with = "OptionMaildirConfigDef")] + pub maildir: Option, + + #[cfg(feature = "notmuch-backend")] + #[serde(default, with = "OptionNotmuchConfigDef")] + pub notmuch: Option, + + #[cfg(feature = "smtp-sender")] + #[serde(default, with = "OptionSmtpConfigDef")] + pub smtp: Option, + + #[serde(default, with = "OptionSendmailConfigDef")] + pub sendmail: Option, #[cfg(feature = "pgp")] - #[serde(default, with = "PgpConfigDef")] - pub pgp: PgpConfig, -} - -impl DeserializedAccountConfig { - pub fn to_account_config(&self, name: String, config: &DeserializedConfig) -> AccountConfig { - let mut folder_aliases = config - .folder_aliases - .as_ref() - .map(ToOwned::to_owned) - .unwrap_or_default(); - folder_aliases.extend( - self.folder_aliases - .as_ref() - .map(ToOwned::to_owned) - .unwrap_or_default(), - ); - - AccountConfig { - name: name.clone(), - email: self.email.to_owned(), - display_name: self - .display_name - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.display_name.as_ref().map(ToOwned::to_owned)), - signature_delim: self - .signature_delim - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.signature_delim.as_ref().map(ToOwned::to_owned)), - signature: self - .signature - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.signature.as_ref().map(ToOwned::to_owned)), - downloads_dir: self - .downloads_dir - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.downloads_dir.as_ref().map(ToOwned::to_owned)), - folder_listing_page_size: self - .folder_listing_page_size - .or_else(|| config.folder_listing_page_size), - folder_aliases, - email_listing_page_size: self - .email_listing_page_size - .or_else(|| config.email_listing_page_size), - email_listing_datetime_fmt: self - .email_listing_datetime_fmt - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| { - config - .email_listing_datetime_fmt - .as_ref() - .map(ToOwned::to_owned) - }), - email_listing_datetime_local_tz: self - .email_listing_datetime_local_tz - .or_else(|| config.email_listing_datetime_local_tz), - email_reading_headers: self - .email_reading_headers - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.email_reading_headers.as_ref().map(ToOwned::to_owned)), - email_reading_format: self.email_reading_format.clone(), - email_writing_headers: self - .email_writing_headers - .as_ref() - .map(ToOwned::to_owned) - .or_else(|| config.email_writing_headers.as_ref().map(ToOwned::to_owned)), - email_sending_save_copy: self.email_sending_save_copy.unwrap_or(true), - email_hooks: EmailHooks { - pre_send: self.email_hooks.pre_send.clone(), - }, - sync: self.sync.unwrap_or_default(), - sync_dir: self.sync_dir.clone(), - sync_folders_strategy: self.sync_folders_strategy.clone(), - - backend: { - let mut backend = self.backend.clone(); - - #[cfg(feature = "imap-backend")] - if let BackendConfig::Imap(config) = &mut backend { - match &mut config.auth { - ImapAuthConfig::Passwd(secret) => { - secret.set_keyring_entry_if_undefined(format!("{name}-imap-passwd")); - } - ImapAuthConfig::OAuth2(config) => { - config.client_secret.set_keyring_entry_if_undefined(format!( - "{name}-imap-oauth2-client-secret" - )); - config.access_token.set_keyring_entry_if_undefined(format!( - "{name}-imap-oauth2-access-token" - )); - config.refresh_token.set_keyring_entry_if_undefined(format!( - "{name}-imap-oauth2-refresh-token" - )); - } - }; - } - - backend - }, - sender: { - let mut sender = self.sender.clone(); - - #[cfg(feature = "smtp-sender")] - if let SenderConfig::Smtp(config) = &mut sender { - match &mut config.auth { - SmtpAuthConfig::Passwd(secret) => { - secret.set_keyring_entry_if_undefined(format!("{name}-smtp-passwd")); - } - SmtpAuthConfig::OAuth2(config) => { - config.client_secret.set_keyring_entry_if_undefined(format!( - "{name}-smtp-oauth2-client-secret" - )); - config.access_token.set_keyring_entry_if_undefined(format!( - "{name}-smtp-oauth2-access-token" - )); - config.refresh_token.set_keyring_entry_if_undefined(format!( - "{name}-smtp-oauth2-refresh-token" - )); - } - }; - } - - sender - }, - #[cfg(feature = "pgp")] - pgp: self.pgp.clone(), - } - } + #[serde(default, with = "OptionPgpConfigDef")] + pub pgp: Option, } diff --git a/src/domain/account/handlers.rs b/src/domain/account/handlers.rs index 56c0a7e..bec3fc3 100644 --- a/src/domain/account/handlers.rs +++ b/src/domain/account/handlers.rs @@ -2,25 +2,22 @@ //! //! This module gathers all account actions triggered by the CLI. -use anyhow::Result; -#[cfg(feature = "imap-backend")] -use email::backend::ImapAuthConfig; -#[cfg(feature = "smtp-sender")] -use email::sender::SmtpAuthConfig; -use email::{ - account::{ - sync::{AccountSyncBuilder, AccountSyncProgressEvent}, - AccountConfig, - }, - backend::BackendConfig, - sender::SenderConfig, +use anyhow::{Context, Result}; +use email::account::{ + sync::{AccountSyncBuilder, AccountSyncProgressEvent}, + AccountConfig, }; +#[cfg(feature = "imap-backend")] +use email::imap::ImapAuthConfig; +#[cfg(feature = "smtp-sender")] +use email::smtp::SmtpAuthConfig; use indicatif::{MultiProgress, ProgressBar, ProgressFinish, ProgressStyle}; use log::{info, trace, warn}; use once_cell::sync::Lazy; use std::{collections::HashMap, sync::Mutex}; use crate::{ + backend::BackendContextBuilder, config::{ wizard::{prompt_passwd, prompt_secret}, DeserializedConfig, @@ -48,68 +45,68 @@ const SUB_PROGRESS_DONE_STYLE: Lazy = Lazy::new(|| { pub async fn configure(config: &AccountConfig, reset: bool) -> Result<()> { info!("entering the configure account handler"); - if reset { - #[cfg(feature = "imap-backend")] - if let BackendConfig::Imap(imap_config) = &config.backend { - let reset = match &imap_config.auth { - ImapAuthConfig::Passwd(passwd) => passwd.reset(), - ImapAuthConfig::OAuth2(oauth2) => oauth2.reset(), - }; - if let Err(err) = reset { - warn!("error while resetting imap secrets, skipping it"); - warn!("{err}"); - } - } + // if reset { + // #[cfg(feature = "imap-backend")] + // if let BackendConfig::Imap(imap_config) = &config.backend { + // let reset = match &imap_config.auth { + // ImapAuthConfig::Passwd(passwd) => passwd.reset(), + // ImapAuthConfig::OAuth2(oauth2) => oauth2.reset(), + // }; + // if let Err(err) = reset { + // warn!("error while resetting imap secrets, skipping it"); + // warn!("{err}"); + // } + // } - #[cfg(feature = "smtp-sender")] - if let SenderConfig::Smtp(smtp_config) = &config.sender { - let reset = match &smtp_config.auth { - SmtpAuthConfig::Passwd(passwd) => passwd.reset(), - SmtpAuthConfig::OAuth2(oauth2) => oauth2.reset(), - }; - if let Err(err) = reset { - warn!("error while resetting smtp secrets, skipping it"); - warn!("{err}"); - } - } + // #[cfg(feature = "smtp-sender")] + // if let SenderConfig::Smtp(smtp_config) = &config.sender { + // let reset = match &smtp_config.auth { + // SmtpAuthConfig::Passwd(passwd) => passwd.reset(), + // SmtpAuthConfig::OAuth2(oauth2) => oauth2.reset(), + // }; + // if let Err(err) = reset { + // warn!("error while resetting smtp secrets, skipping it"); + // warn!("{err}"); + // } + // } - #[cfg(feature = "pgp")] - config.pgp.reset().await?; - } + // #[cfg(feature = "pgp")] + // config.pgp.reset().await?; + // } - #[cfg(feature = "imap-backend")] - if let BackendConfig::Imap(imap_config) = &config.backend { - match &imap_config.auth { - ImapAuthConfig::Passwd(passwd) => { - passwd.configure(|| prompt_passwd("IMAP password")).await - } - ImapAuthConfig::OAuth2(oauth2) => { - oauth2 - .configure(|| prompt_secret("IMAP OAuth 2.0 client secret")) - .await - } - }?; - } + // #[cfg(feature = "imap-backend")] + // if let BackendConfig::Imap(imap_config) = &config.backend { + // match &imap_config.auth { + // ImapAuthConfig::Passwd(passwd) => { + // passwd.configure(|| prompt_passwd("IMAP password")).await + // } + // ImapAuthConfig::OAuth2(oauth2) => { + // oauth2 + // .configure(|| prompt_secret("IMAP OAuth 2.0 client secret")) + // .await + // } + // }?; + // } - #[cfg(feature = "smtp-sender")] - if let SenderConfig::Smtp(smtp_config) = &config.sender { - match &smtp_config.auth { - SmtpAuthConfig::Passwd(passwd) => { - passwd.configure(|| prompt_passwd("SMTP password")).await - } - SmtpAuthConfig::OAuth2(oauth2) => { - oauth2 - .configure(|| prompt_secret("SMTP OAuth 2.0 client secret")) - .await - } - }?; - } + // #[cfg(feature = "smtp-sender")] + // if let SenderConfig::Smtp(smtp_config) = &config.sender { + // match &smtp_config.auth { + // SmtpAuthConfig::Passwd(passwd) => { + // passwd.configure(|| prompt_passwd("SMTP password")).await + // } + // SmtpAuthConfig::OAuth2(oauth2) => { + // oauth2 + // .configure(|| prompt_secret("SMTP OAuth 2.0 client secret")) + // .await + // } + // }?; + // } - #[cfg(feature = "pgp")] - config - .pgp - .configure(&config.email, || prompt_passwd("PGP secret key password")) - .await?; + // #[cfg(feature = "pgp")] + // config + // .pgp + // .configure(&config.email, || prompt_passwd("PGP secret key password")) + // .await?; println!( "Account successfully {}configured!", @@ -147,7 +144,7 @@ pub fn list<'a, P: Printer>( /// no account given, synchronizes the default one. pub async fn sync( printer: &mut P, - sync_builder: AccountSyncBuilder, + sync_builder: AccountSyncBuilder, dry_run: bool, ) -> Result<()> { info!("entering the sync accounts handler"); diff --git a/src/domain/account/wizard.rs b/src/domain/account/wizard.rs index 306b9fd..f64f394 100644 --- a/src/domain/account/wizard.rs +++ b/src/domain/account/wizard.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Result}; use dialoguer::Input; use email_address::EmailAddress; -use crate::{backend, config::wizard::THEME, sender}; +use crate::config::wizard::THEME; use super::DeserializedAccountConfig; @@ -31,9 +31,9 @@ pub(crate) async fn configure() -> Result Result<()> { imap.notify(keepalive, folder).await?; diff --git a/src/domain/backend/imap/mod.rs b/src/domain/backend/imap/mod.rs index 723c3b8..b6c153f 100644 --- a/src/domain/backend/imap/mod.rs +++ b/src/domain/backend/imap/mod.rs @@ -1,3 +1,3 @@ pub mod args; -pub mod handlers; -pub(crate) mod wizard; +// pub mod handlers; +// pub(crate) mod wizard; diff --git a/src/domain/backend/maildir/mod.rs b/src/domain/backend/maildir/mod.rs index 73818b4..d4b1a6e 100644 --- a/src/domain/backend/maildir/mod.rs +++ b/src/domain/backend/maildir/mod.rs @@ -1 +1 @@ -pub(crate) mod wizard; +// pub(crate) mod wizard; diff --git a/src/domain/backend/mod.rs b/src/domain/backend/mod.rs index 548ca7c..b33f50e 100644 --- a/src/domain/backend/mod.rs +++ b/src/domain/backend/mod.rs @@ -3,4 +3,4 @@ pub mod imap; pub mod maildir; #[cfg(feature = "notmuch-backend")] pub mod notmuch; -pub(crate) mod wizard; +// pub(crate) mod wizard; diff --git a/src/domain/email/handlers.rs b/src/domain/email/handlers.rs index cc6f276..3589ea7 100644 --- a/src/domain/email/handlers.rs +++ b/src/domain/email/handlers.rs @@ -2,9 +2,7 @@ use anyhow::{anyhow, Context, Result}; use atty::Stream; use email::{ account::AccountConfig, - backend::Backend, - email::{template::FilterParts, Flag, Flags, Message, MessageBuilder}, - sender::Sender, + email::{envelope::Id, template::FilterParts, Flag, Message, MessageBuilder}, }; use log::{debug, trace}; use std::{ @@ -15,6 +13,7 @@ use url::Url; use uuid::Uuid; use crate::{ + backend::Backend, printer::{PrintTableOpts, Printer}, ui::editor, Envelopes, IdMapper, @@ -24,20 +23,20 @@ pub async fn attachments( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - let emails = backend.get_emails(&folder, ids.clone()).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + let emails = backend.get_messages(&folder, &ids).await?; let mut index = 0; let mut emails_count = 0; let mut attachments_count = 0; + let mut ids = ids.iter(); for email in emails.to_vec() { - let id = ids.get(index).unwrap(); + let id = ids.next().unwrap(); let attachments = email.attachments()?; index = index + 1; @@ -79,27 +78,27 @@ pub async fn attachments( pub async fn copy( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, from_folder: &str, to_folder: &str, ids: Vec<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.copy_emails(&from_folder, &to_folder, ids).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend + .copy_messages(&from_folder, &to_folder, &ids) + .await?; printer.print("Email(s) successfully copied!") } pub async fn delete( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.delete_emails(&folder, ids).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend.delete_messages(&folder, &ids).await?; printer.print("Email(s) successfully deleted!") } @@ -107,18 +106,15 @@ pub async fn forward( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, folder: &str, id: &str, headers: Option>, body: Option<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids([id])?; - let ids = ids.iter().map(String::as_str).collect::>(); - + let id = Id::single(id_mapper.get_id(id)?); let tpl = backend - .get_emails(&folder, ids) + .get_messages(&folder, &id) .await? .first() .ok_or_else(|| anyhow!("cannot find email {}", id))? @@ -128,7 +124,7 @@ pub async fn forward( .build() .await?; trace!("initial template: {tpl}"); - editor::edit_tpl_with_editor(config, printer, backend, sender, tpl).await?; + editor::edit_tpl_with_editor(config, printer, backend, tpl).await?; Ok(()) } @@ -136,7 +132,7 @@ pub async fn list( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, max_width: Option, page_size: Option, @@ -166,8 +162,7 @@ pub async fn list( /// [mailto]: https://en.wikipedia.org/wiki/Mailto pub async fn mailto( config: &AccountConfig, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, printer: &mut P, url: &Url, ) -> Result<()> { @@ -190,20 +185,21 @@ pub async fn mailto( .from_msg_builder(builder) .await?; - editor::edit_tpl_with_editor(config, printer, backend, sender, tpl).await + editor::edit_tpl_with_editor(config, printer, backend, tpl).await } pub async fn move_( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, from_folder: &str, to_folder: &str, ids: Vec<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.move_emails(&from_folder, &to_folder, ids).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend + .move_messages(&from_folder, &to_folder, &ids) + .await?; printer.print("Email(s) successfully moved!") } @@ -211,16 +207,15 @@ pub async fn read( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, text_mime: &str, raw: bool, headers: Vec<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - let emails = backend.get_emails(&folder, ids).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + let emails = backend.get_messages(&folder, &ids).await?; let mut glue = ""; let mut bodies = String::default(); @@ -255,19 +250,16 @@ pub async fn reply( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, folder: &str, id: &str, all: bool, headers: Option>, body: Option<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids([id])?; - let ids = ids.iter().map(String::as_str).collect::>(); - + let id = Id::single(id_mapper.get_id(id)?); let tpl = backend - .get_emails(&folder, ids) + .get_messages(folder, &id) .await? .first() .ok_or_else(|| anyhow!("cannot find email {}", id))? @@ -278,17 +270,15 @@ pub async fn reply( .build() .await?; trace!("initial template: {tpl}"); - editor::edit_tpl_with_editor(config, printer, backend, sender, tpl).await?; - backend - .add_flags(&folder, vec![id], &Flags::from_iter([Flag::Answered])) - .await?; + editor::edit_tpl_with_editor(config, printer, backend, tpl).await?; + backend.add_flag(&folder, &id, Flag::Answered).await?; Ok(()) } pub async fn save( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, raw_email: String, ) -> Result<()> { @@ -306,73 +296,74 @@ pub async fn save( }; let id = backend - .add_email(&folder, raw_email.as_bytes(), &Flags::default()) + .add_raw_message(&folder, raw_email.as_bytes()) .await?; - id_mapper.create_alias(id)?; + id_mapper.create_alias(&*id)?; Ok(()) } pub async fn search( - config: &AccountConfig, - printer: &mut P, - id_mapper: &IdMapper, - backend: &mut dyn Backend, - folder: &str, - query: String, - max_width: Option, - page_size: Option, - page: usize, + _config: &AccountConfig, + _printer: &mut P, + _id_mapper: &IdMapper, + _backend: &Backend, + _folder: &str, + _query: String, + _max_width: Option, + _page_size: Option, + _page: usize, ) -> Result<()> { - let page_size = page_size.unwrap_or(config.email_listing_page_size()); - let envelopes = Envelopes::from_backend( - config, - id_mapper, - backend - .search_envelopes(&folder, &query, "", page_size, page) - .await?, - )?; - let opts = PrintTableOpts { - format: &config.email_reading_format, - max_width, - }; + todo!() + // let page_size = page_size.unwrap_or(config.email_listing_page_size()); + // let envelopes = Envelopes::from_backend( + // config, + // id_mapper, + // backend + // .search_envelopes(&folder, &query, "", page_size, page) + // .await?, + // )?; + // let opts = PrintTableOpts { + // format: &config.email_reading_format, + // max_width, + // }; - printer.print_table(Box::new(envelopes), opts) + // printer.print_table(Box::new(envelopes), opts) } pub async fn sort( - config: &AccountConfig, - printer: &mut P, - id_mapper: &IdMapper, - backend: &mut dyn Backend, - folder: &str, - sort: String, - query: String, - max_width: Option, - page_size: Option, - page: usize, + _config: &AccountConfig, + _printer: &mut P, + _id_mapper: &IdMapper, + _backend: &Backend, + _folder: &str, + _sort: String, + _query: String, + _max_width: Option, + _page_size: Option, + _page: usize, ) -> Result<()> { - let page_size = page_size.unwrap_or(config.email_listing_page_size()); - let envelopes = Envelopes::from_backend( - config, - id_mapper, - backend - .search_envelopes(&folder, &query, &sort, page_size, page) - .await?, - )?; - let opts = PrintTableOpts { - format: &config.email_reading_format, - max_width, - }; + todo!() + // let page_size = page_size.unwrap_or(config.email_listing_page_size()); + // let envelopes = Envelopes::from_backend( + // config, + // id_mapper, + // backend + // .search_envelopes(&folder, &query, &sort, page_size, page) + // .await?, + // )?; + // let opts = PrintTableOpts { + // format: &config.email_reading_format, + // max_width, + // }; - printer.print_table(Box::new(envelopes), opts) + // printer.print_table(Box::new(envelopes), opts) } pub async fn send( config: &AccountConfig, printer: &mut P, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, raw_email: String, ) -> Result<()> { let folder = config.sent_folder_alias()?; @@ -389,14 +380,10 @@ pub async fn send( .join("\r\n") }; trace!("raw email: {:?}", raw_email); - sender.send(raw_email.as_bytes()).await?; - if config.email_sending_save_copy { + backend.send_raw_message(raw_email.as_bytes()).await?; + if config.email_sending_save_copy.unwrap_or_default() { backend - .add_email( - &folder, - raw_email.as_bytes(), - &Flags::from_iter([Flag::Seen]), - ) + .add_raw_message_with_flag(&folder, raw_email.as_bytes(), Flag::Seen) .await?; } Ok(()) @@ -405,8 +392,7 @@ pub async fn send( pub async fn write( config: &AccountConfig, printer: &mut P, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, headers: Option>, body: Option<&str>, ) -> Result<()> { @@ -416,6 +402,6 @@ pub async fn write( .build() .await?; trace!("initial template: {tpl}"); - editor::edit_tpl_with_editor(config, printer, backend, sender, tpl).await?; + editor::edit_tpl_with_editor(config, printer, backend, tpl).await?; Ok(()) } diff --git a/src/domain/flag/handlers.rs b/src/domain/flag/handlers.rs index 04a5fde..875718f 100644 --- a/src/domain/flag/handlers.rs +++ b/src/domain/flag/handlers.rs @@ -1,46 +1,43 @@ use anyhow::Result; -use email::{backend::Backend, email::Flags}; +use email::email::{envelope::Id, Flags}; -use crate::{printer::Printer, IdMapper}; +use crate::{backend::Backend, printer::Printer, IdMapper}; pub async fn add( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, flags: &Flags, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.add_flags(folder, ids, flags).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend.add_flags(folder, &ids, flags).await?; printer.print("Flag(s) successfully added!") } pub async fn set( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, flags: &Flags, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.set_flags(folder, ids, flags).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend.set_flags(folder, &ids, flags).await?; printer.print("Flag(s) successfully set!") } pub async fn remove( printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, ids: Vec<&str>, flags: &Flags, ) -> Result<()> { - let ids = id_mapper.get_ids(ids)?; - let ids = ids.iter().map(String::as_str).collect::>(); - backend.remove_flags(folder, ids, flags).await?; + let ids = Id::multiple(id_mapper.get_ids(ids)?); + backend.remove_flags(folder, &ids, flags).await?; printer.print("Flag(s) successfully removed!") } diff --git a/src/domain/folder/handlers.rs b/src/domain/folder/handlers.rs index 5664e07..9c6937e 100644 --- a/src/domain/folder/handlers.rs +++ b/src/domain/folder/handlers.rs @@ -4,19 +4,16 @@ use anyhow::Result; use dialoguer::Confirm; -use email::{account::AccountConfig, backend::Backend}; +use email::account::AccountConfig; use std::process; use crate::{ + backend::Backend, printer::{PrintTableOpts, Printer}, Folders, }; -pub async fn expunge( - printer: &mut P, - backend: &mut dyn Backend, - folder: &str, -) -> Result<()> { +pub async fn expunge(printer: &mut P, backend: &Backend, folder: &str) -> Result<()> { backend.expunge_folder(folder).await?; printer.print(format!("Folder {folder} successfully expunged!")) } @@ -24,7 +21,7 @@ pub async fn expunge( pub async fn list( config: &AccountConfig, printer: &mut P, - backend: &mut dyn Backend, + backend: &Backend, max_width: Option, ) -> Result<()> { let folders: Folders = backend.list_folders().await?.into(); @@ -38,20 +35,12 @@ pub async fn list( ) } -pub async fn create( - printer: &mut P, - backend: &mut dyn Backend, - folder: &str, -) -> Result<()> { +pub async fn create(printer: &mut P, backend: &Backend, folder: &str) -> Result<()> { backend.add_folder(folder).await?; printer.print("Folder successfully created!") } -pub async fn delete( - printer: &mut P, - backend: &mut dyn Backend, - folder: &str, -) -> Result<()> { +pub async fn delete(printer: &mut P, backend: &Backend, folder: &str) -> Result<()> { if let Some(false) | None = Confirm::new() .with_prompt(format!("Confirm deletion of folder {folder}?")) .default(false) diff --git a/src/domain/sender/mod.rs b/src/domain/sender/mod.rs index 4a237dc..eab09f5 100644 --- a/src/domain/sender/mod.rs +++ b/src/domain/sender/mod.rs @@ -1,4 +1,4 @@ pub mod sendmail; #[cfg(feature = "smtp-sender")] pub mod smtp; -pub(crate) mod wizard; +// pub(crate) mod wizard; diff --git a/src/domain/sender/sendmail/mod.rs b/src/domain/sender/sendmail/mod.rs index 73818b4..d4b1a6e 100644 --- a/src/domain/sender/sendmail/mod.rs +++ b/src/domain/sender/sendmail/mod.rs @@ -1 +1 @@ -pub(crate) mod wizard; +// pub(crate) mod wizard; diff --git a/src/domain/sender/smtp/mod.rs b/src/domain/sender/smtp/mod.rs index 73818b4..d4b1a6e 100644 --- a/src/domain/sender/smtp/mod.rs +++ b/src/domain/sender/smtp/mod.rs @@ -1 +1 @@ -pub(crate) mod wizard; +// pub(crate) mod wizard; diff --git a/src/domain/sender/wizard.rs b/src/domain/sender/wizard.rs index d382df1..bb4b9d6 100644 --- a/src/domain/sender/wizard.rs +++ b/src/domain/sender/wizard.rs @@ -1,6 +1,5 @@ use anyhow::Result; use dialoguer::Select; -use email::sender::SenderConfig; use crate::config::wizard::THEME; diff --git a/src/domain/tpl/handlers.rs b/src/domain/tpl/handlers.rs index a682930..a7515e4 100644 --- a/src/domain/tpl/handlers.rs +++ b/src/domain/tpl/handlers.rs @@ -2,30 +2,27 @@ use anyhow::{anyhow, Result}; use atty::Stream; use email::{ account::AccountConfig, - backend::Backend, - email::{Flag, Flags, Message}, - sender::Sender, + email::{envelope::Id, Flag, Message}, }; use mml::MmlCompilerBuilder; use std::io::{stdin, BufRead}; -use crate::{printer::Printer, IdMapper}; +use crate::{backend::Backend, printer::Printer, IdMapper}; pub async fn forward( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, id: &str, headers: Option>, body: Option<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids([id])?; - let ids = ids.iter().map(String::as_str).collect::>(); + let ids = Id::multiple(id_mapper.get_ids([id])?); let tpl: String = backend - .get_emails(folder, ids) + .get_messages(folder, &ids) .await? .first() .ok_or_else(|| anyhow!("cannot find email {}", id))? @@ -43,18 +40,17 @@ pub async fn reply( config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, id: &str, all: bool, headers: Option>, body: Option<&str>, ) -> Result<()> { - let ids = id_mapper.get_ids([id])?; - let ids = ids.iter().map(String::as_str).collect::>(); + let ids = Id::multiple(id_mapper.get_ids([id])?); let tpl: String = backend - .get_emails(folder, ids) + .get_messages(folder, &ids) .await? .first() .ok_or_else(|| anyhow!("cannot find email {}", id))? @@ -73,7 +69,7 @@ pub async fn save( #[allow(unused_variables)] config: &AccountConfig, printer: &mut P, id_mapper: &IdMapper, - backend: &mut dyn Backend, + backend: &Backend, folder: &str, tpl: String, ) -> Result<()> { @@ -95,8 +91,8 @@ pub async fn save( let email = compiler.build(tpl.as_str())?.compile().await?.into_vec()?; - let id = backend.add_email(folder, &email, &Flags::default()).await?; - id_mapper.create_alias(id)?; + let id = backend.add_raw_message(folder, &email).await?; + id_mapper.create_alias(&*id)?; printer.print("Template successfully saved!") } @@ -104,8 +100,7 @@ pub async fn save( pub async fn send( config: &AccountConfig, printer: &mut P, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, tpl: String, ) -> Result<()> { let folder = config.sent_folder_alias()?; @@ -128,11 +123,11 @@ pub async fn send( let email = compiler.build(tpl.as_str())?.compile().await?.into_vec()?; - sender.send(&email).await?; + backend.send_raw_message(&email).await?; - if config.email_sending_save_copy { + if config.email_sending_save_copy.unwrap_or_default() { backend - .add_email(&folder, &email, &Flags::from_iter([Flag::Seen])) + .add_raw_message_with_flag(&folder, &email, Flag::Seen) .await?; } diff --git a/src/lib.rs b/src/lib.rs index f22abe8..d1b00f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +pub mod backend; pub mod cache; pub mod compl; pub mod config; diff --git a/src/main.rs b/src/main.rs index 5a174dc..5256932 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,4 @@ -#[cfg(feature = "imap-backend")] -use ::email::backend::ImapBackend; -use ::email::{ - account::{sync::AccountSyncBuilder, DEFAULT_INBOX_FOLDER}, - backend::{BackendBuilder, BackendConfig}, - sender::SenderBuilder, -}; +use ::email::account::{sync::AccountSyncBuilder, DEFAULT_INBOX_FOLDER}; use anyhow::{anyhow, Context, Result}; use clap::Command; use log::{debug, warn}; @@ -14,7 +8,9 @@ use url::Url; #[cfg(feature = "imap-backend")] use himalaya::imap; use himalaya::{ - account, cache, compl, + account, + backend::BackendBuilder, + cache, compl, config::{self, DeserializedConfig}, email, flag, folder, man, output, printer::StdoutPrinter, @@ -60,21 +56,19 @@ async fn main() -> Result<()> { // checks mailto command before app initialization let raw_args: Vec = env::args().collect(); if raw_args.len() > 1 && raw_args[1].starts_with("mailto:") { - let url = Url::parse(&raw_args[1])?; - let config = DeserializedConfig::from_opt_path(None).await?; - let account_config = config.to_account_config(None)?; - let mut backend = BackendBuilder::new(account_config.clone()).build().await?; - let mut sender = SenderBuilder::new(account_config.clone()).build().await?; - let mut printer = StdoutPrinter::default(); + // let url = Url::parse(&raw_args[1])?; + // let config = DeserializedConfig::from_opt_path(None).await?; + // let account_config = config.to_account_config(None)?; + // let backend = BackendBuilder::new(account_config.clone()).build().await?; + // let mut printer = StdoutPrinter::default(); - email::handlers::mailto( - &account_config, - backend.as_mut(), - sender.as_mut(), - &mut printer, - &url, - ) - .await?; + // email::handlers::mailto( + // &account_config, + // &backend, + // &mut printer, + // &url, + // ) + // .await?; return Ok(()); } @@ -100,37 +94,33 @@ async fn main() -> Result<()> { } let config = DeserializedConfig::from_opt_path(config::args::parse_arg(&m)).await?; - let account_config = config.to_account_config(account::args::parse_arg(&m))?; + let maybe_account_name = account::args::parse_arg(&m); let folder = folder::args::parse_source_arg(&m); let disable_cache = cache::args::parse_disable_cache_flag(&m); - // FIXME: find why account config cannot be borrowed - // let backend_builder = - // BackendBuilder::new(Cow::Borrowed(&account_config)).with_cache_disabled(disable_cache); - let backend_builder = - BackendBuilder::new(account_config.clone()).with_cache_disabled(disable_cache); - let sender_builder = SenderBuilder::new(account_config.clone()); + let backend_builder = BackendBuilder::new(config.clone(), maybe_account_name).await?; + let account_config = &backend_builder.account_config; let mut printer = StdoutPrinter::try_from(&m)?; - #[cfg(feature = "imap-backend")] - if let BackendConfig::Imap(imap_config) = &account_config.backend { - let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - match imap::args::matches(&m)? { - Some(imap::args::Cmd::Notify(keepalive)) => { - let mut backend = - ImapBackend::new(account_config.clone(), imap_config.clone(), None).await?; - imap::handlers::notify(&mut backend, &folder, keepalive).await?; - return Ok(()); - } - Some(imap::args::Cmd::Watch(keepalive)) => { - let mut backend = - ImapBackend::new(account_config.clone(), imap_config.clone(), None).await?; - imap::handlers::watch(&mut backend, &folder, keepalive).await?; - return Ok(()); - } - _ => (), - } - } + // #[cfg(feature = "imap-backend")] + // if let BackendConfig::Imap(imap_config) = &account_config.backend { + // let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); + // match imap::args::matches(&m)? { + // Some(imap::args::Cmd::Notify(keepalive)) => { + // let backend = + // ImapBackend::new(account_config.clone(), imap_config.clone(), None).await?; + // imap::handlers::notify(&mut backend, &folder, keepalive).await?; + // return Ok(()); + // } + // Some(imap::args::Cmd::Watch(keepalive)) => { + // let backend = + // ImapBackend::new(account_config.clone(), imap_config.clone(), None).await?; + // imap::handlers::watch(&mut backend, &folder, keepalive).await?; + // return Ok(()); + // } + // _ => (), + // } + // } match account::args::matches(&m)? { Some(account::args::Cmd::List(max_width)) => { @@ -138,7 +128,7 @@ async fn main() -> Result<()> { return Ok(()); } Some(account::args::Cmd::Sync(strategy, dry_run)) => { - let sync_builder = AccountSyncBuilder::new(account_config, backend_builder) + let sync_builder = AccountSyncBuilder::new(backend_builder.0) .await? .with_some_folders_strategy(strategy) .with_dry_run(dry_run); @@ -158,26 +148,25 @@ async fn main() -> Result<()> { let folder = folder .ok_or_else(|| anyhow!("the folder argument is missing")) .context("cannot create folder")?; - let mut backend = backend_builder.build().await?; - folder::handlers::create(&mut printer, backend.as_mut(), &folder).await?; + let backend = backend_builder.clone().build().await?; + folder::handlers::create(&mut printer, &backend, &folder).await?; return Ok(()); } Some(folder::args::Cmd::List(max_width)) => { - let mut backend = backend_builder.build().await?; - folder::handlers::list(&account_config, &mut printer, backend.as_mut(), max_width) - .await?; + let backend = backend_builder.clone().build().await?; + folder::handlers::list(&account_config, &mut printer, &backend, max_width).await?; return Ok(()); } Some(folder::args::Cmd::Expunge) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.build().await?; - folder::handlers::expunge(&mut printer, backend.as_mut(), &folder).await?; + let backend = backend_builder.clone().build().await?; + folder::handlers::expunge(&mut printer, &backend, &folder).await?; return Ok(()); } Some(folder::args::Cmd::Delete) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.build().await?; - folder::handlers::delete(&mut printer, backend.as_mut(), &folder).await?; + let backend = backend_builder.clone().build().await?; + folder::handlers::delete(&mut printer, &backend, &folder).await?; return Ok(()); } _ => (), @@ -187,13 +176,13 @@ async fn main() -> Result<()> { match email::args::matches(&m)? { Some(email::args::Cmd::Attachments(ids)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::attachments( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, ids, ) @@ -202,43 +191,33 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::Copy(ids, to_folder)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - email::handlers::copy( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - to_folder, - ids, - ) - .await?; + email::handlers::copy(&mut printer, &id_mapper, &backend, &folder, to_folder, ids) + .await?; return Ok(()); } Some(email::args::Cmd::Delete(ids)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - email::handlers::delete(&mut printer, &id_mapper, backend.as_mut(), &folder, ids) - .await?; + email::handlers::delete(&mut printer, &id_mapper, &backend, &folder, ids).await?; return Ok(()); } Some(email::args::Cmd::Forward(id, headers, body)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let mut sender = sender_builder.build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::forward( &account_config, &mut printer, &id_mapper, - backend.as_mut(), - sender.as_mut(), + &backend, &folder, id, headers, @@ -250,14 +229,14 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::List(max_width, page_size, page)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::list( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, max_width, page_size, @@ -269,31 +248,24 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::Move(ids, to_folder)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - email::handlers::move_( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - to_folder, - ids, - ) - .await?; + email::handlers::move_(&mut printer, &id_mapper, &backend, &folder, to_folder, ids) + .await?; return Ok(()); } Some(email::args::Cmd::Read(ids, text_mime, raw, headers)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::read( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, ids, text_mime, @@ -306,16 +278,14 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::Reply(id, all, headers, body)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let mut sender = sender_builder.build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::reply( &account_config, &mut printer, &id_mapper, - backend.as_mut(), - sender.as_mut(), + &backend, &folder, id, all, @@ -328,30 +298,23 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::Save(raw_email)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - email::handlers::save( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - raw_email, - ) - .await?; + email::handlers::save(&mut printer, &id_mapper, &backend, &folder, raw_email).await?; return Ok(()); } Some(email::args::Cmd::Search(query, max_width, page_size, page)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::search( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, query, max_width, @@ -364,14 +327,14 @@ async fn main() -> Result<()> { } Some(email::args::Cmd::Sort(criteria, query, max_width, page_size, page)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; email::handlers::sort( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, criteria, query, @@ -384,68 +347,39 @@ async fn main() -> Result<()> { return Ok(()); } Some(email::args::Cmd::Send(raw_email)) => { - let mut backend = backend_builder.build().await?; - let mut sender = sender_builder.build().await?; - email::handlers::send( - &account_config, - &mut printer, - backend.as_mut(), - sender.as_mut(), - raw_email, - ) - .await?; + let backend = backend_builder.clone().build().await?; + email::handlers::send(&account_config, &mut printer, &backend, raw_email).await?; return Ok(()); } Some(email::args::Cmd::Flag(m)) => match m { Some(flag::args::Cmd::Set(ids, ref flags)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - flag::handlers::set( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - ids, - flags, - ) - .await?; + flag::handlers::set(&mut printer, &id_mapper, &backend, &folder, ids, flags) + .await?; return Ok(()); } Some(flag::args::Cmd::Add(ids, ref flags)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - flag::handlers::add( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - ids, - flags, - ) - .await?; + flag::handlers::add(&mut printer, &id_mapper, &backend, &folder, ids, flags) + .await?; return Ok(()); } Some(flag::args::Cmd::Remove(ids, ref flags)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; - flag::handlers::remove( - &mut printer, - &id_mapper, - backend.as_mut(), - &folder, - ids, - flags, - ) - .await?; + flag::handlers::remove(&mut printer, &id_mapper, &backend, &folder, ids, flags) + .await?; return Ok(()); } @@ -454,14 +388,14 @@ async fn main() -> Result<()> { Some(email::args::Cmd::Tpl(m)) => match m { Some(tpl::args::Cmd::Forward(id, headers, body)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; tpl::handlers::forward( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, id, headers, @@ -477,14 +411,14 @@ async fn main() -> Result<()> { } Some(tpl::args::Cmd::Reply(id, all, headers, body)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; tpl::handlers::reply( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, id, all, @@ -497,14 +431,14 @@ async fn main() -> Result<()> { } Some(tpl::args::Cmd::Save(tpl)) => { let folder = folder.unwrap_or(DEFAULT_INBOX_FOLDER); - let mut backend = backend_builder.clone().into_build().await?; - let id_mapper = IdMapper::new(backend.as_ref(), &account_config, &folder)?; + let backend = backend_builder.clone().build().await?; + let id_mapper = IdMapper::new(&backend, &account_config, &folder)?; tpl::handlers::save( &account_config, &mut printer, &id_mapper, - backend.as_mut(), + &backend, &folder, tpl, ) @@ -513,33 +447,16 @@ async fn main() -> Result<()> { return Ok(()); } Some(tpl::args::Cmd::Send(tpl)) => { - let mut backend = backend_builder.clone().into_build().await?; - let mut sender = sender_builder.build().await?; - tpl::handlers::send( - &account_config, - &mut printer, - backend.as_mut(), - sender.as_mut(), - tpl, - ) - .await?; + let backend = backend_builder.clone().build().await?; + tpl::handlers::send(&account_config, &mut printer, &backend, tpl).await?; return Ok(()); } _ => (), }, Some(email::args::Cmd::Write(headers, body)) => { - let mut backend = backend_builder.build().await?; - let mut sender = sender_builder.build().await?; - email::handlers::write( - &account_config, - &mut printer, - backend.as_mut(), - sender.as_mut(), - headers, - body, - ) - .await?; + let backend = backend_builder.clone().build().await?; + email::handlers::write(&account_config, &mut printer, &backend, headers, body).await?; return Ok(()); } diff --git a/src/ui/editor.rs b/src/ui/editor.rs index f9a7bda..34eb59d 100644 --- a/src/ui/editor.rs +++ b/src/ui/editor.rs @@ -1,9 +1,7 @@ use anyhow::{Context, Result}; use email::{ account::AccountConfig, - backend::Backend, email::{local_draft_path, remove_local_draft, Flag, Flags}, - sender::Sender, }; use log::debug; use mml::MmlCompilerBuilder; @@ -11,6 +9,7 @@ use process::Cmd; use std::{env, fs}; use crate::{ + backend::Backend, printer::Printer, ui::choice::{self, PostEditChoice, PreEditChoice}, }; @@ -45,8 +44,7 @@ pub async fn open_with_local_draft() -> Result { pub async fn edit_tpl_with_editor( config: &AccountConfig, printer: &mut P, - backend: &mut dyn Backend, - sender: &mut dyn Sender, + backend: &Backend, mut tpl: String, ) -> Result<()> { let draft = local_draft_path(); @@ -86,13 +84,13 @@ pub async fn edit_tpl_with_editor( let email = compiler.build(tpl.as_str())?.compile().await?.into_vec()?; - sender.send(&email).await?; + backend.send_raw_message(&email).await?; - if config.email_sending_save_copy { + if config.email_sending_save_copy.unwrap_or_default() { let sent_folder = config.sent_folder_alias()?; printer.print_log(format!("Adding email to the {} folder…", sent_folder))?; backend - .add_email(&sent_folder, &email, &Flags::from_iter([Flag::Seen])) + .add_raw_message_with_flag(&sent_folder, &email, Flag::Seen) .await?; } @@ -117,7 +115,7 @@ pub async fn edit_tpl_with_editor( let email = compiler.build(tpl.as_str())?.compile().await?.into_vec()?; backend - .add_email( + .add_raw_message_with_flags( "drafts", &email, &Flags::from_iter([Flag::Seen, Flag::Draft]),