update deps

This commit is contained in:
Clément DOUIN 2024-04-07 11:42:34 +02:00
parent d95f277bab
commit 58df66b5fa
No known key found for this signature in database
GPG key ID: 353E4A18EE0FAB72
11 changed files with 517 additions and 582 deletions

261
Cargo.lock generated
View file

@ -186,22 +186,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3"
dependencies = [
"concurrent-queue",
"event-listener 5.2.0",
"event-listener-strategy 0.5.0",
"event-listener 5.3.0",
"event-listener-strategy 0.5.1",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.8.0"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
checksum = "10b3e585719c2358d2660232671ca8ca4ddb4be4ce8a1842d6c2dc8685303316"
dependencies = [
"async-lock 3.3.0",
"async-task",
"concurrent-queue",
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-lite 2.3.0",
"slab",
]
@ -250,7 +250,7 @@ dependencies = [
"futures-io",
"futures-lite 2.3.0",
"parking",
"polling 3.5.0",
"polling 3.6.0",
"rustix 0.38.32",
"slab",
"tracing",
@ -302,7 +302,7 @@ checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -331,13 +331,13 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]]
name = "async-trait"
version = "0.1.78"
version = "0.1.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85"
checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -359,9 +359,9 @@ dependencies = [
[[package]]
name = "autocfg"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
[[package]]
name = "backtrace"
@ -475,7 +475,7 @@ dependencies = [
"async-channel",
"async-lock 3.3.0",
"async-task",
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-io",
"futures-lite 2.3.0",
"piper",
@ -619,9 +619,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.35"
version = "0.4.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a"
checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e"
dependencies = [
"android-tzdata",
"iana-time-zone",
@ -634,8 +634,9 @@ dependencies = [
[[package]]
name = "chumsky"
version = "1.0.0-alpha.6"
source = "git+https://github.com/zesterer/chumsky.git?rev=6837537#68375371a5fde6ee14f190c14e9a9cee0697f022"
version = "1.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7b80276986f86789dc56ca6542d53bba9cda3c66091ebbe7bd96fc1bdf20f1f"
dependencies = [
"hashbrown",
"regex-automata 0.3.9",
@ -665,9 +666,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.3"
version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813"
checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
dependencies = [
"clap_builder",
"clap_derive",
@ -682,7 +683,7 @@ dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim 0.11.0",
"strsim 0.11.1",
]
[[package]]
@ -696,14 +697,14 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.3"
version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f"
checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -908,7 +909,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -995,9 +996,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "der"
version = "0.7.8"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c"
checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0"
dependencies = [
"const-oid",
"pem-rfc7468",
@ -1218,7 +1219,7 @@ dependencies = [
[[package]]
name = "email-lib"
version = "0.22.3"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"advisory-lock",
"async-trait",
@ -1267,10 +1268,10 @@ dependencies = [
[[package]]
name = "email-macros"
version = "0.0.2"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -1306,7 +1307,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -1327,7 +1328,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -1398,9 +1399,9 @@ dependencies = [
[[package]]
name = "event-listener"
version = "5.2.0"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91"
checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24"
dependencies = [
"concurrent-queue",
"parking",
@ -1419,11 +1420,11 @@ dependencies = [
[[package]]
name = "event-listener-strategy"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291"
checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3"
dependencies = [
"event-listener 5.2.0",
"event-listener 5.3.0",
"pin-project-lite",
]
@ -1438,9 +1439,9 @@ dependencies = [
[[package]]
name = "fastrand"
version = "2.0.1"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
[[package]]
name = "ff"
@ -1601,7 +1602,7 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-core",
"futures-io",
"parking",
@ -1616,7 +1617,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -1681,9 +1682,9 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.2.12"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
checksum = "a06fddc2749e0528d2813f95e050e87e52c8cbbae56223b9babf73b3e53b0cc6"
dependencies = [
"cfg-if",
"js-sys",
@ -1752,9 +1753,9 @@ dependencies = [
[[package]]
name = "h2"
version = "0.3.25"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb"
checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
dependencies = [
"bytes",
"fnv",
@ -2211,9 +2212,9 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.10"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "jobserver"
@ -2255,8 +2256,8 @@ dependencies = [
[[package]]
name = "keyring-lib"
version = "0.4.0"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "0.4.1"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"keyring",
"log",
@ -2320,13 +2321,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "libredox"
version = "0.0.1"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags 2.5.0",
"libc",
"redox_syscall 0.4.1",
]
[[package]]
@ -2397,9 +2397,9 @@ dependencies = [
[[package]]
name = "mail-auth"
version = "0.3.9"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84725ed2de724f96bfe85cb4a0c06ac9a77fe612915675220525682ebdfdd7fa"
checksum = "4e9759ecef5c0d048464fee80947ca5ef25faff98add10ea8787a6e195b8dc5f"
dependencies = [
"ahash",
"flate2",
@ -2410,7 +2410,7 @@ dependencies = [
"parking_lot 0.12.1",
"quick-xml 0.31.0",
"ring 0.17.8",
"rustls-pemfile 2.1.1",
"rustls-pemfile 2.1.2",
"serde",
"serde_json",
"zip",
@ -2427,9 +2427,9 @@ dependencies = [
[[package]]
name = "mail-parser"
version = "0.9.2"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7af1b812c3c16317ccadacb0db823f04c2872dfc5a1125f171f4a22d1705e9a7"
checksum = "ed5a1335c3a964788c90cb42ae04a34b5f2628e89566949ce3bd4ada695c0bcd"
dependencies = [
"encoding_rs",
]
@ -2446,7 +2446,7 @@ dependencies = [
"mail-builder",
"md5",
"rand",
"rustls 0.22.2",
"rustls 0.22.3",
"rustls-pki-types",
"smtp-proto",
"tokio",
@ -2498,9 +2498,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
[[package]]
name = "memchr"
version = "2.7.1"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
[[package]]
name = "memoffset"
@ -2513,9 +2513,9 @@ dependencies = [
[[package]]
name = "memoffset"
version = "0.9.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
dependencies = [
"autocfg",
]
@ -2555,8 +2555,8 @@ dependencies = [
[[package]]
name = "mml-lib"
version = "1.0.8"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "1.0.10"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"async-recursion",
"chumsky",
@ -2708,7 +2708,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -2771,8 +2771,8 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "oauth-lib"
version = "0.1.0"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "0.1.1"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"log",
"oauth2",
@ -2928,7 +2928,7 @@ dependencies = [
"proc-macro2",
"proc-macro2-diagnostics",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -3117,9 +3117,9 @@ dependencies = [
[[package]]
name = "pgp-lib"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d61233a437ba3de6396593cb27fda4e48ba7c7415756caffe9f9d5d0d07378c"
checksum = "c6802b1ef0dfc50217185a1eda6ddd546b65ffa8b80f942aa1feda6536adf165"
dependencies = [
"async-recursion",
"futures",
@ -3138,9 +3138,9 @@ dependencies = [
[[package]]
name = "pin-project-lite"
version = "0.2.13"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
[[package]]
name = "pin-utils"
@ -3155,7 +3155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
dependencies = [
"atomic-waker",
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-io",
]
@ -3188,9 +3188,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
[[package]]
name = "platforms"
version = "3.3.0"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c"
checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7"
[[package]]
name = "polling"
@ -3210,12 +3210,13 @@ dependencies = [
[[package]]
name = "polling"
version = "3.5.0"
version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9"
checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi 0.3.9",
"pin-project-lite",
"rustix 0.38.32",
"tracing",
@ -3300,15 +3301,15 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
"version_check",
"yansi 1.0.1",
]
[[package]]
name = "process-lib"
version = "0.4.1"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "0.4.2"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"log",
"serde",
@ -3390,9 +3391,9 @@ dependencies = [
[[package]]
name = "rayon"
version = "1.9.0"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd"
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
dependencies = [
"either",
"rayon-core",
@ -3428,9 +3429,9 @@ dependencies = [
[[package]]
name = "redox_users"
version = "0.4.4"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
dependencies = [
"getrandom",
"libredox",
@ -3446,7 +3447,7 @@ dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.6",
"regex-syntax 0.8.2",
"regex-syntax 0.8.3",
]
[[package]]
@ -3468,7 +3469,7 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.2",
"regex-syntax 0.8.3",
]
[[package]]
@ -3479,9 +3480,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "regex-syntax"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
[[package]]
name = "reqwest"
@ -3665,9 +3666,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.22.2"
version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41"
checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c"
dependencies = [
"log",
"ring 0.17.8",
@ -3684,7 +3685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5bd40675c79c896f46d0031bf64c448b35e583dd2bc949751ddd800351e453a"
dependencies = [
"log",
"rustls 0.22.2",
"rustls 0.22.3",
"rustls-native-certs 0.7.0",
"rustls-pki-types",
"rustls-webpki 0.102.2",
@ -3709,7 +3710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792"
dependencies = [
"openssl-probe",
"rustls-pemfile 2.1.1",
"rustls-pemfile 2.1.2",
"rustls-pki-types",
"schannel",
"security-framework",
@ -3726,19 +3727,19 @@ dependencies = [
[[package]]
name = "rustls-pemfile"
version = "2.1.1"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab"
checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d"
dependencies = [
"base64 0.21.7",
"base64 0.22.0",
"rustls-pki-types",
]
[[package]]
name = "rustls-pki-types"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "868e20fada228fefaf6b652e00cc73623d54f8171e7352c18bb281571f2d92da"
checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247"
[[package]]
name = "rustls-webpki"
@ -3817,8 +3818,8 @@ dependencies = [
[[package]]
name = "secret-lib"
version = "0.4.1"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "0.4.3"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"keyring-lib",
"log",
@ -3848,9 +3849,9 @@ dependencies = [
[[package]]
name = "security-framework"
version = "2.9.2"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de"
checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
@ -3861,9 +3862,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
version = "2.9.1"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a"
checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef"
dependencies = [
"core-foundation-sys",
"libc",
@ -3913,14 +3914,14 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
name = "serde_json"
version = "1.0.114"
version = "1.0.115"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
dependencies = [
"itoa",
"ryu",
@ -3945,7 +3946,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -4020,8 +4021,8 @@ dependencies = [
[[package]]
name = "shellexpand-utils"
version = "0.2.0"
source = "git+https://git.sr.ht/~soywod/pimalaya#dd8bada6ef4efb097490a7bfe1ca0499dac6dbf0"
version = "0.2.1"
source = "git+https://git.sr.ht/~soywod/pimalaya#ac7af0ccc2a42a64885654286048c74b9d9c800f"
dependencies = [
"log",
"shellexpand",
@ -4159,9 +4160,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strsim"
version = "0.11.0"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "subtle"
@ -4182,9 +4183,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.53"
version = "2.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032"
checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
dependencies = [
"proc-macro2",
"quote",
@ -4254,7 +4255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
dependencies = [
"cfg-if",
"fastrand 2.0.1",
"fastrand 2.0.2",
"rustix 0.38.32",
"windows-sys 0.52.0",
]
@ -4295,7 +4296,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -4334,9 +4335,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.36.0"
version = "1.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
dependencies = [
"backtrace",
"bytes",
@ -4359,7 +4360,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -4378,7 +4379,7 @@ version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f"
dependencies = [
"rustls 0.22.2",
"rustls 0.22.3",
"rustls-pki-types",
"tokio",
]
@ -4467,7 +4468,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -4520,7 +4521,7 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset 0.9.0",
"memoffset 0.9.1",
"tempfile",
"winapi",
]
@ -4672,7 +4673,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
"wasm-bindgen-shared",
]
@ -4706,7 +4707,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -4744,9 +4745,9 @@ dependencies = [
[[package]]
name = "widestring"
version = "1.0.2"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8"
checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311"
[[package]]
name = "winapi"
@ -5000,9 +5001,9 @@ dependencies = [
[[package]]
name = "xml-rs"
version = "0.8.19"
version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a"
checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193"
[[package]]
name = "yansi"
@ -5106,7 +5107,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -5126,7 +5127,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.58",
]
[[package]]
@ -5170,9 +5171,9 @@ dependencies = [
[[package]]
name = "zstd-sys"
version = "2.0.9+zstd.1.5.5"
version = "2.0.10+zstd.1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656"
checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa"
dependencies = [
"cc",
"pkg-config",

View file

@ -64,19 +64,19 @@ email_address = "0.2.4"
env_logger = "0.8"
erased-serde = "0.3"
indicatif = "0.17"
keyring-lib = { version = "=0.4.0", features = ["derive"] }
keyring-lib = { version = "=0.4.1", features = ["derive"] }
log = "0.4"
mail-builder = "0.3"
md5 = "0.7"
mml-lib = { version = "=1.0.8", default-features = false, features = ["derive"] }
oauth-lib = "=0.1.0"
mml-lib = { version = "=1.0.10", default-features = false, features = ["derive"] }
oauth-lib = "=0.1.1"
once_cell = "1.16"
process-lib = { version = "=0.4.1", features = ["derive"] }
secret-lib = { version = "=0.4.1", features = ["derive"] }
process-lib = { version = "=0.4.2", features = ["derive"] }
secret-lib = { version = "=0.4.3", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde-toml-merge = "0.3"
serde_json = "1"
shellexpand-utils = "=0.2.0"
shellexpand-utils = "=0.2.1"
sled = "=0.34.7"
termcolor = "1"
terminal_size = "0.1"
@ -91,10 +91,8 @@ uuid = { version = "0.8", features = ["v4"] }
version = "0.1"
[patch.crates-io]
# waiting for alpha 7
chumsky = { git = "https://github.com/zesterer/chumsky.git", rev = "6837537" }
email-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
email-lib = { path = "/home/soywod/sourcehut/pimalaya/email" }
# email-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
email-macros = { git = "https://git.sr.ht/~soywod/pimalaya" }
keyring-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
mml-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
@ -102,12 +100,3 @@ oauth-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
process-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
secret-lib = { git = "https://git.sr.ht/~soywod/pimalaya" }
shellexpand-utils = { git = "https://git.sr.ht/~soywod/pimalaya" }
# email-lib = { path = "/home/soywod/sourcehut/pimalaya/email" }
# email-macros = { path = "/home/soywod/sourcehut/pimalaya/email-macros" }
# keyring-lib = { path = "/home/soywod/sourcehut/pimalaya/keyring" }
# mml-lib = { path = "/home/soywod/sourcehut/pimalaya/mml" }
# oauth-lib = { path = "/home/soywod/sourcehut/pimalaya/oauth" }
# process-lib = { path = "/home/soywod/sourcehut/pimalaya/process" }
# secret-lib = { path = "/home/soywod/sourcehut/pimalaya/secret" }
# shellexpand-utils = { path = "/home/soywod/sourcehut/pimalaya/shellexpand-utils" }

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use email::backend::context::BackendContextBuilder;
use log::info;
@ -42,11 +42,7 @@ impl AccountCheckUpCommand {
)
.await?;
let ctx = ctx_builder
.clone()
.build()
.await
.map_err(|err| anyhow!(err))?;
let ctx = ctx_builder.clone().build().await?;
#[cfg(feature = "maildir")]
{
@ -59,7 +55,7 @@ impl AccountCheckUpCommand {
.and_then(|f| ctx.maildir.as_ref().and_then(|ctx| f(ctx)));
if let Some(maildir) = maildir.as_ref() {
maildir.check_up().await.map_err(|err| anyhow!(err))?;
maildir.check_up().await?;
}
}
@ -74,7 +70,7 @@ impl AccountCheckUpCommand {
.and_then(|f| ctx.imap.as_ref().and_then(|ctx| f(ctx)));
if let Some(imap) = imap.as_ref() {
imap.check_up().await.map_err(|err| anyhow!(err))?;
imap.check_up().await?;
}
}
@ -89,7 +85,7 @@ impl AccountCheckUpCommand {
.and_then(|f| ctx.notmuch.as_ref().and_then(|ctx| f(ctx)));
if let Some(notmuch) = notmuch.as_ref() {
notmuch.check_up().await.map_err(|err| anyhow!(err))?;
notmuch.check_up().await?;
}
}
@ -104,7 +100,7 @@ impl AccountCheckUpCommand {
.and_then(|f| ctx.smtp.as_ref().and_then(|ctx| f(ctx)));
if let Some(smtp) = smtp.as_ref() {
smtp.check_up().await.map_err(|err| anyhow!(err))?;
smtp.check_up().await?;
}
}
@ -119,7 +115,7 @@ impl AccountCheckUpCommand {
.and_then(|f| ctx.sendmail.as_ref().and_then(|ctx| f(ctx)));
if let Some(sendmail) = sendmail.as_ref() {
sendmail.check_up().await.map_err(|err| anyhow!(err))?;
sendmail.check_up().await?;
}
}

View file

@ -102,8 +102,7 @@ impl AccountSyncCommand {
.ok_or_else(|| anyhow!("imap config not found"))?;
let imap_ctx = ImapContextBuilder::new(account_config.clone(), imap_config)
.with_prebuilt_credentials()
.await
.map_err(|err| anyhow!(err))?;
.await?;
let imap = BackendBuilder::new(account_config.clone(), imap_ctx);
self.sync(printer, account_name, imap).await
}
@ -135,11 +134,7 @@ impl AccountSyncCommand {
AccountSyncBuilder::try_new(right)?.with_some_folders_filter(folders_filter);
if self.dry_run {
let report = sync_builder
.with_dry_run(true)
.sync()
.await
.map_err(|err| anyhow!(err))?;
let report = sync_builder.with_dry_run(true).sync().await?;
let mut hunks_count = report.folder.patch.len();
if !report.folder.patch.is_empty() {
@ -163,7 +158,7 @@ impl AccountSyncCommand {
"Estimated patch length for account {account_name} to be synchronized: {hunks_count}"
))?;
} else if printer.is_json() {
sync_builder.sync().await.map_err(|err| anyhow!(err))?;
sync_builder.sync().await?;
printer.print(format!("Account {account_name} successfully synchronized!"))?;
} else {
let multi = MultiProgress::new();
@ -235,8 +230,7 @@ impl AccountSyncCommand {
async { Ok(()) }
})
.sync()
.await
.map_err(|err| anyhow!(err))?;
.await?;
let folders_patch_err = report
.folder

View file

@ -1,7 +1,7 @@
pub mod config;
pub(crate) mod wizard;
use anyhow::{anyhow, Result};
use anyhow::Result;
use async_trait::async_trait;
use std::{ops::Deref, sync::Arc};
@ -41,6 +41,7 @@ use email::{
send::{SendMessage, SendMessageThenSaveCopy},
Messages,
},
AnyResult,
};
use serde::{Deserialize, Serialize};
@ -143,7 +144,7 @@ impl BackendContextBuilder {
.with_prebuilt_credentials()
});
match builder {
Some(builder) => Some(builder.await.map_err(|err| anyhow!(err))?),
Some(builder) => Some(builder.await?),
None => None,
}
},
@ -514,7 +515,7 @@ impl email::backend::context::BackendContextBuilder for BackendContextBuilder {
}
}
async fn build(self) -> email::Result<Self::Context> {
async fn build(self) -> AnyResult<Self::Context> {
let mut ctx = BackendContext::default();
#[cfg(feature = "imap")]
@ -634,7 +635,7 @@ impl Backend {
Ok(Self {
toml_account_config: toml_account_config.clone(),
backend: backend_builder.build().await.map_err(|err| anyhow!(err))?,
backend: backend_builder.build().await?,
})
}
@ -678,12 +679,9 @@ impl Backend {
) -> Result<Envelopes> {
let backend_kind = self.toml_account_config.list_envelopes_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let envelopes = self
.backend
.list_envelopes(folder, opts)
.await
.map_err(|err| anyhow!(err))?;
let envelopes = Envelopes::from_backend(&self.account_config, &id_mapper, envelopes)?;
let envelopes = self.backend.list_envelopes(folder, opts).await?;
let envelopes =
Envelopes::from_backend(&self.backend.account_config, &id_mapper, envelopes)?;
Ok(envelopes)
}
@ -691,70 +689,54 @@ impl Backend {
let backend_kind = self.toml_account_config.add_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.add_flags(folder, &ids, flags)
.await
.map_err(|err| anyhow!(err))
self.backend.add_flags(folder, &ids, flags).await?;
Ok(())
}
pub async fn add_flag(&self, folder: &str, ids: &[usize], flag: Flag) -> Result<()> {
let backend_kind = self.toml_account_config.add_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.add_flag(folder, &ids, flag)
.await
.map_err(|err| anyhow!(err))
self.backend.add_flag(folder, &ids, flag).await?;
Ok(())
}
pub async fn set_flags(&self, folder: &str, ids: &[usize], flags: &Flags) -> Result<()> {
let backend_kind = self.toml_account_config.set_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.set_flags(folder, &ids, flags)
.await
.map_err(|err| anyhow!(err))
self.backend.set_flags(folder, &ids, flags).await?;
Ok(())
}
pub async fn set_flag(&self, folder: &str, ids: &[usize], flag: Flag) -> Result<()> {
let backend_kind = self.toml_account_config.set_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.set_flag(folder, &ids, flag)
.await
.map_err(|err| anyhow!(err))
self.backend.set_flag(folder, &ids, flag).await?;
Ok(())
}
pub async fn remove_flags(&self, folder: &str, ids: &[usize], flags: &Flags) -> Result<()> {
let backend_kind = self.toml_account_config.remove_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.remove_flags(folder, &ids, flags)
.await
.map_err(|err| anyhow!(err))
self.backend.remove_flags(folder, &ids, flags).await?;
Ok(())
}
pub async fn remove_flag(&self, folder: &str, ids: &[usize], flag: Flag) -> Result<()> {
let backend_kind = self.toml_account_config.remove_flags_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.remove_flag(folder, &ids, flag)
.await
.map_err(|err| anyhow!(err))
self.backend.remove_flag(folder, &ids, flag).await?;
Ok(())
}
pub async fn add_message(&self, folder: &str, email: &[u8]) -> Result<SingleId> {
let backend_kind = self.toml_account_config.add_message_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let id = self
.backend
.add_message(folder, email)
.await
.map_err(|err| anyhow!(err))?;
let id = self.backend.add_message(folder, email).await?;
id_mapper.create_alias(&*id)?;
Ok(id)
}
@ -770,8 +752,7 @@ impl Backend {
let id = self
.backend
.add_message_with_flags(folder, email, flags)
.await
.map_err(|err| anyhow!(err))?;
.await?;
id_mapper.create_alias(&*id)?;
Ok(id)
}
@ -780,20 +761,16 @@ impl Backend {
let backend_kind = self.toml_account_config.get_messages_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.peek_messages(folder, &ids)
.await
.map_err(|err| anyhow!(err))
let msgs = self.backend.peek_messages(folder, &ids).await?;
Ok(msgs)
}
pub async fn get_messages(&self, folder: &str, ids: &[usize]) -> Result<Messages> {
let backend_kind = self.toml_account_config.get_messages_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.get_messages(folder, &ids)
.await
.map_err(|err| anyhow!(err))
let msgs = self.backend.get_messages(folder, &ids).await?;
Ok(msgs)
}
pub async fn copy_messages(
@ -807,8 +784,8 @@ impl Backend {
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.copy_messages(from_folder, to_folder, &ids)
.await
.map_err(|err| anyhow!(err))
.await?;
Ok(())
}
pub async fn move_messages(
@ -822,32 +799,26 @@ impl Backend {
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.move_messages(from_folder, to_folder, &ids)
.await
.map_err(|err| anyhow!(err))
.await?;
Ok(())
}
pub async fn delete_messages(&self, folder: &str, ids: &[usize]) -> Result<()> {
let backend_kind = self.toml_account_config.delete_messages_kind();
let id_mapper = self.build_id_mapper(folder, backend_kind)?;
let ids = Id::multiple(id_mapper.get_ids(ids)?);
self.backend
.delete_messages(folder, &ids)
.await
.map_err(|err| anyhow!(err))
self.backend.delete_messages(folder, &ids).await?;
Ok(())
}
pub async fn send_message_then_save_copy(&self, msg: &[u8]) -> Result<()> {
self.backend
.send_message_then_save_copy(msg)
.await
.map_err(|err| anyhow!(err))
self.backend.send_message_then_save_copy(msg).await?;
Ok(())
}
pub async fn watch_envelopes(&self, folder: &str) -> Result<()> {
self.backend
.watch_envelopes(folder)
.await
.map_err(|err| anyhow!(err))
self.backend.watch_envelopes(folder).await?;
Ok(())
}
}

View file

@ -187,351 +187,351 @@ fn set_tables_dotted<'a>(item: &'a mut Item, keys: impl IntoIterator<Item = &'a
}
}
#[cfg(test)]
mod test {
use std::collections::HashMap;
// #[cfg(test)]
// mod test {
// use std::collections::HashMap;
use crate::{account::config::TomlAccountConfig, config::TomlConfig};
// use crate::{account::config::TomlAccountConfig, config::TomlConfig};
use super::pretty_serialize;
// use super::pretty_serialize;
fn assert_eq(config: TomlAccountConfig, expected_toml: &str) {
let config = TomlConfig {
accounts: HashMap::from_iter([("test".into(), config)]),
..Default::default()
};
// fn assert_eq(config: TomlAccountConfig, expected_toml: &str) {
// let config = TomlConfig {
// accounts: HashMap::from_iter([("test".into(), config)]),
// ..Default::default()
// };
let toml = pretty_serialize(&config).expect("serialize error");
assert_eq!(toml, expected_toml);
// let toml = pretty_serialize(&config).expect("serialize error");
// assert_eq!(toml, expected_toml);
let expected_config = toml::from_str(&toml).expect("deserialize error");
assert_eq!(config, expected_config);
}
// let expected_config = toml::from_str(&toml).expect("deserialize error");
// assert_eq!(config, expected_config);
// }
#[test]
fn pretty_serialize_default() {
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
"#,
)
}
// #[test]
// fn pretty_serialize_default() {
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// "#,
// )
// }
#[cfg(feature = "account-sync")]
#[test]
fn pretty_serialize_sync_all() {
use email::account::sync::config::SyncConfig;
// #[cfg(feature = "account-sync")]
// #[test]
// fn pretty_serialize_sync_all() {
// use email::account::sync::config::SyncConfig;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
sync: Some(SyncConfig {
enable: Some(false),
dir: Some("/tmp/test".into()),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
sync.enable = false
sync.dir = "/tmp/test"
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// sync: Some(SyncConfig {
// enable: Some(false),
// dir: Some("/tmp/test".into()),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// sync.enable = false
// sync.dir = "/tmp/test"
// "#,
// );
// }
#[cfg(feature = "account-sync")]
#[test]
fn pretty_serialize_sync_include() {
use email::{
account::sync::config::SyncConfig,
folder::sync::config::{FolderSyncConfig, FolderSyncStrategy},
};
use std::collections::BTreeSet;
// #[cfg(feature = "account-sync")]
// #[test]
// fn pretty_serialize_sync_include() {
// use email::{
// account::sync::config::SyncConfig,
// folder::sync::config::{FolderSyncConfig, FolderSyncStrategy},
// };
// use std::collections::BTreeSet;
use crate::folder::config::FolderConfig;
// use crate::folder::config::FolderConfig;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
sync: Some(SyncConfig {
enable: Some(true),
dir: Some("/tmp/test".into()),
..Default::default()
}),
folder: Some(FolderConfig {
sync: Some(FolderSyncConfig {
filter: FolderSyncStrategy::Include(BTreeSet::from_iter(["test".into()])),
..Default::default()
}),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
sync.enable = true
sync.dir = "/tmp/test"
folder.sync.filter.include = ["test"]
folder.sync.permissions.create = true
folder.sync.permissions.delete = true
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// sync: Some(SyncConfig {
// enable: Some(true),
// dir: Some("/tmp/test".into()),
// ..Default::default()
// }),
// folder: Some(FolderConfig {
// sync: Some(FolderSyncConfig {
// filter: FolderSyncStrategy::Include(BTreeSet::from_iter(["test".into()])),
// ..Default::default()
// }),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// sync.enable = true
// sync.dir = "/tmp/test"
// folder.sync.filter.include = ["test"]
// folder.sync.permissions.create = true
// folder.sync.permissions.delete = true
// "#,
// );
// }
#[cfg(feature = "imap")]
#[test]
fn pretty_serialize_imap_passwd_cmd() {
use email::{
account::config::passwd::PasswdConfig,
imap::config::{ImapAuthConfig, ImapConfig},
};
use secret::Secret;
// #[cfg(feature = "imap")]
// #[test]
// fn pretty_serialize_imap_passwd_cmd() {
// use email::{
// account::config::passwd::PasswdConfig,
// imap::config::{ImapAuthConfig, ImapConfig},
// };
// use secret::Secret;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
imap: Some(ImapConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: ImapAuthConfig::Passwd(PasswdConfig(Secret::new_command(
"pass show test",
))),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
imap.host = "localhost"
imap.port = 143
imap.login = "test@localhost"
imap.passwd.command = "pass show test"
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// imap: Some(ImapConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: ImapAuthConfig::Passwd(PasswdConfig(Secret::new_command(
// "pass show test",
// ))),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// imap.host = "localhost"
// imap.port = 143
// imap.login = "test@localhost"
// imap.passwd.command = "pass show test"
// "#,
// );
// }
#[cfg(feature = "imap")]
#[test]
fn pretty_serialize_imap_passwd_cmds() {
use email::{
account::config::passwd::PasswdConfig,
imap::config::{ImapAuthConfig, ImapConfig},
};
use secret::Secret;
// #[cfg(feature = "imap")]
// #[test]
// fn pretty_serialize_imap_passwd_cmds() {
// use email::{
// account::config::passwd::PasswdConfig,
// imap::config::{ImapAuthConfig, ImapConfig},
// };
// use secret::Secret;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
imap: Some(ImapConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: ImapAuthConfig::Passwd(PasswdConfig(Secret::new_command(vec![
"pass show test",
"tr -d '[:blank:]'",
]))),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
imap.host = "localhost"
imap.port = 143
imap.login = "test@localhost"
imap.passwd.command = ["pass show test", "tr -d '[:blank:]'"]
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// imap: Some(ImapConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: ImapAuthConfig::Passwd(PasswdConfig(Secret::new_command(vec![
// "pass show test",
// "tr -d '[:blank:]'",
// ]))),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// imap.host = "localhost"
// imap.port = 143
// imap.login = "test@localhost"
// imap.passwd.command = ["pass show test", "tr -d '[:blank:]'"]
// "#,
// );
// }
#[cfg(feature = "imap")]
#[test]
fn pretty_serialize_imap_oauth2() {
use email::{
account::config::oauth2::OAuth2Config,
imap::config::{ImapAuthConfig, ImapConfig},
};
// #[cfg(feature = "imap")]
// #[test]
// fn pretty_serialize_imap_oauth2() {
// use email::{
// account::config::oauth2::OAuth2Config,
// imap::config::{ImapAuthConfig, ImapConfig},
// };
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
imap: Some(ImapConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: ImapAuthConfig::OAuth2(OAuth2Config {
client_id: "client-id".into(),
auth_url: "auth-url".into(),
token_url: "token-url".into(),
..Default::default()
}),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
imap.host = "localhost"
imap.port = 143
imap.login = "test@localhost"
imap.oauth2.method = "xoauth2"
imap.oauth2.client-id = "client-id"
imap.oauth2.auth-url = "auth-url"
imap.oauth2.token-url = "token-url"
imap.oauth2.pkce = false
imap.oauth2.scopes = []
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// imap: Some(ImapConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: ImapAuthConfig::OAuth2(OAuth2Config {
// client_id: "client-id".into(),
// auth_url: "auth-url".into(),
// token_url: "token-url".into(),
// ..Default::default()
// }),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// imap.host = "localhost"
// imap.port = 143
// imap.login = "test@localhost"
// imap.oauth2.method = "xoauth2"
// imap.oauth2.client-id = "client-id"
// imap.oauth2.auth-url = "auth-url"
// imap.oauth2.token-url = "token-url"
// imap.oauth2.pkce = false
// imap.oauth2.scopes = []
// "#,
// );
// }
#[cfg(feature = "maildir")]
#[test]
fn pretty_serialize_maildir() {
use email::maildir::config::MaildirConfig;
// #[cfg(feature = "maildir")]
// #[test]
// fn pretty_serialize_maildir() {
// use email::maildir::config::MaildirConfig;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
maildir: Some(MaildirConfig {
root_dir: "/tmp/test".into(),
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
maildir.root-dir = "/tmp/test"
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// maildir: Some(MaildirConfig {
// root_dir: "/tmp/test".into(),
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// maildir.root-dir = "/tmp/test"
// "#,
// );
// }
#[cfg(feature = "smtp")]
#[test]
fn pretty_serialize_smtp_passwd_cmd() {
use email::{
account::config::passwd::PasswdConfig,
smtp::config::{SmtpAuthConfig, SmtpConfig},
};
use secret::Secret;
// #[cfg(feature = "smtp")]
// #[test]
// fn pretty_serialize_smtp_passwd_cmd() {
// use email::{
// account::config::passwd::PasswdConfig,
// smtp::config::{SmtpAuthConfig, SmtpConfig},
// };
// use secret::Secret;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
smtp: Some(SmtpConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: SmtpAuthConfig::Passwd(PasswdConfig(Secret::new_command(
"pass show test",
))),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
smtp.host = "localhost"
smtp.port = 143
smtp.login = "test@localhost"
smtp.passwd.command = "pass show test"
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// smtp: Some(SmtpConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: SmtpAuthConfig::Passwd(PasswdConfig(Secret::new_command(
// "pass show test",
// ))),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// smtp.host = "localhost"
// smtp.port = 143
// smtp.login = "test@localhost"
// smtp.passwd.command = "pass show test"
// "#,
// );
// }
#[cfg(feature = "smtp")]
#[test]
fn pretty_serialize_smtp_passwd_cmds() {
use email::{
account::config::passwd::PasswdConfig,
smtp::config::{SmtpAuthConfig, SmtpConfig},
};
use secret::Secret;
// #[cfg(feature = "smtp")]
// #[test]
// fn pretty_serialize_smtp_passwd_cmds() {
// use email::{
// account::config::passwd::PasswdConfig,
// smtp::config::{SmtpAuthConfig, SmtpConfig},
// };
// use secret::Secret;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
smtp: Some(SmtpConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: SmtpAuthConfig::Passwd(PasswdConfig(Secret::new_command(vec![
"pass show test",
"tr -d '[:blank:]'",
]))),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
smtp.host = "localhost"
smtp.port = 143
smtp.login = "test@localhost"
smtp.passwd.command = ["pass show test", "tr -d '[:blank:]'"]
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// smtp: Some(SmtpConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: SmtpAuthConfig::Passwd(PasswdConfig(Secret::new_command(vec![
// "pass show test",
// "tr -d '[:blank:]'",
// ]))),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// smtp.host = "localhost"
// smtp.port = 143
// smtp.login = "test@localhost"
// smtp.passwd.command = ["pass show test", "tr -d '[:blank:]'"]
// "#,
// );
// }
#[cfg(feature = "smtp")]
#[test]
fn pretty_serialize_smtp_oauth2() {
use email::{
account::config::oauth2::OAuth2Config,
smtp::config::{SmtpAuthConfig, SmtpConfig},
};
// #[cfg(feature = "smtp")]
// #[test]
// fn pretty_serialize_smtp_oauth2() {
// use email::{
// account::config::oauth2::OAuth2Config,
// smtp::config::{SmtpAuthConfig, SmtpConfig},
// };
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
smtp: Some(SmtpConfig {
host: "localhost".into(),
port: 143,
login: "test@localhost".into(),
auth: SmtpAuthConfig::OAuth2(OAuth2Config {
client_id: "client-id".into(),
auth_url: "auth-url".into(),
token_url: "token-url".into(),
..Default::default()
}),
..Default::default()
}),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
smtp.host = "localhost"
smtp.port = 143
smtp.login = "test@localhost"
smtp.oauth2.method = "xoauth2"
smtp.oauth2.client-id = "client-id"
smtp.oauth2.auth-url = "auth-url"
smtp.oauth2.token-url = "token-url"
smtp.oauth2.pkce = false
smtp.oauth2.scopes = []
"#,
);
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// smtp: Some(SmtpConfig {
// host: "localhost".into(),
// port: 143,
// login: "test@localhost".into(),
// auth: SmtpAuthConfig::OAuth2(OAuth2Config {
// client_id: "client-id".into(),
// auth_url: "auth-url".into(),
// token_url: "token-url".into(),
// ..Default::default()
// }),
// ..Default::default()
// }),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// smtp.host = "localhost"
// smtp.port = 143
// smtp.login = "test@localhost"
// smtp.oauth2.method = "xoauth2"
// smtp.oauth2.client-id = "client-id"
// smtp.oauth2.auth-url = "auth-url"
// smtp.oauth2.token-url = "token-url"
// smtp.oauth2.pkce = false
// smtp.oauth2.scopes = []
// "#,
// );
// }
#[cfg(feature = "pgp-cmds")]
#[test]
fn pretty_serialize_pgp_cmds() {
use email::account::config::pgp::PgpConfig;
// #[cfg(feature = "pgp-cmds")]
// #[test]
// fn pretty_serialize_pgp_cmds() {
// use email::account::config::pgp::PgpConfig;
assert_eq(
TomlAccountConfig {
email: "test@localhost".into(),
pgp: Some(PgpConfig::Cmds(Default::default())),
..Default::default()
},
r#"[accounts.test]
email = "test@localhost"
pgp.backend = "cmds"
"#,
);
}
}
// assert_eq(
// TomlAccountConfig {
// email: "test@localhost".into(),
// pgp: Some(PgpConfig::Cmds(Default::default())),
// ..Default::default()
// },
// r#"[accounts.test]
// email = "test@localhost"
// pgp.backend = "cmds"
// "#,
// );
// }
// }

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use email::{backend::feature::BackendFeatureSource, folder::add::AddFolder};
use log::info;
@ -48,10 +48,7 @@ impl AddFolderCommand {
)
.await?;
backend
.add_folder(folder)
.await
.map_err(|err| anyhow!(err))?;
backend.add_folder(folder).await?;
printer.print(format!("Folder {folder} successfully created!"))
}

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use dialoguer::Confirm;
use email::{backend::feature::BackendFeatureSource, folder::delete::DeleteFolder};
@ -61,10 +61,7 @@ impl FolderDeleteCommand {
)
.await?;
backend
.delete_folder(folder)
.await
.map_err(|err| anyhow!(err))?;
backend.delete_folder(folder).await?;
printer.print(format!("Folder {folder} successfully deleted!"))
}

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use email::{backend::feature::BackendFeatureSource, folder::expunge::ExpungeFolder};
use log::info;
@ -49,10 +49,7 @@ impl FolderExpungeCommand {
)
.await?;
backend
.expunge_folder(folder)
.await
.map_err(|err| anyhow!(err))?;
backend.expunge_folder(folder).await?;
printer.print(format!("Folder {folder} successfully expunged!"))
}

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use email::{backend::feature::BackendFeatureSource, folder::list::ListFolders};
use log::info;
@ -50,11 +50,7 @@ impl FolderListCommand {
)
.await?;
let folders: Folders = backend
.list_folders()
.await
.map_err(|err| anyhow!(err))?
.into();
let folders: Folders = backend.list_folders().await?.into();
printer.print_table(
Box::new(folders),

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::Result;
use clap::Parser;
use dialoguer::Confirm;
use email::{backend::feature::BackendFeatureSource, folder::purge::PurgeFolder};
@ -61,10 +61,7 @@ impl FolderPurgeCommand {
)
.await?;
backend
.purge_folder(folder)
.await
.map_err(|err| anyhow!(err))?;
backend.purge_folder(folder).await?;
printer.print(format!("Folder {folder} successfully purged!"))
}