diff --git a/Cargo.lock b/Cargo.lock
index 23938a71..c10eb207 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -422,12 +422,6 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
-[[package]]
-name = "base64"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
-
[[package]]
name = "base64"
version = "0.21.5"
@@ -475,26 +469,6 @@ dependencies = [
"serde",
]
-[[package]]
-name = "bindgen"
-version = "0.64.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
-dependencies = [
- "bitflags 1.3.2",
- "cexpr",
- "clang-sys",
- "lazy_static",
- "lazycell",
- "peeking_take_while",
- "proc-macro2",
- "quote",
- "regex",
- "rustc-hash",
- "shlex",
- "syn 1.0.109",
-]
-
[[package]]
name = "bindgen"
version = "0.65.1"
@@ -518,6 +492,26 @@ dependencies = [
"which",
]
+[[package]]
+name = "bindgen"
+version = "0.69.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2"
+dependencies = [
+ "bitflags 2.4.1",
+ "cexpr",
+ "clang-sys",
+ "lazy_static",
+ "lazycell",
+ "peeking_take_while",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash",
+ "shlex",
+ "syn 2.0.39",
+]
+
[[package]]
name = "bit-set"
version = "0.5.3"
@@ -886,9 +880,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.4.8"
+version = "4.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64"
+checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272"
dependencies = [
"clap_builder",
"clap_derive",
@@ -896,9 +890,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.4.8"
+version = "4.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc"
+checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1"
dependencies = [
"anstream",
"anstyle",
@@ -989,9 +983,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
[[package]]
name = "core-foundation"
-version = "0.9.3"
+version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"libc",
@@ -999,9 +993,9 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.8.4"
+version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
+checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "cpufeatures"
@@ -1672,12 +1666,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "errno"
-version = "0.3.7"
+version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8"
+checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
dependencies = [
"libc",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -2236,7 +2230,7 @@ dependencies = [
"rand",
"ring 0.16.20",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"thiserror",
"tinyvec",
"tokio",
@@ -2560,7 +2554,7 @@ dependencies = [
"parking_lot",
"rand",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"store",
"tokio",
"tokio-rustls",
@@ -2829,9 +2823,9 @@ dependencies = [
[[package]]
name = "js-sys"
-version = "0.3.65"
+version = "0.3.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
+checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca"
dependencies = [
"wasm-bindgen",
]
@@ -2847,9 +2841,9 @@ dependencies = [
[[package]]
name = "konst"
-version = "0.3.6"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "030400e39b2dff8beaa55986a17e0014ad657f569ca92426aafcb5e8e71faee7"
+checksum = "29a6ee015a18f4a121ba670f947f801b207139f0f810b3cd266e319065129782"
dependencies = [
"const_panic",
"konst_kernel",
@@ -2980,11 +2974,11 @@ dependencies = [
[[package]]
name = "librocksdb-sys"
-version = "0.10.0+7.9.2"
+version = "0.11.0+8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b"
+checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e"
dependencies = [
- "bindgen 0.64.0",
+ "bindgen 0.65.1",
"bzip2-sys",
"cc",
"glob",
@@ -3024,9 +3018,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
-version = "0.4.11"
+version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829"
+checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
[[package]]
name = "lock_api"
@@ -3094,8 +3088,8 @@ dependencies = [
"mail-parser",
"parking_lot",
"quick-xml 0.30.0",
- "ring 0.17.5",
- "rustls-pemfile",
+ "ring 0.17.6",
+ "rustls-pemfile 1.0.4",
"serde",
"serde_json",
"zip",
@@ -3120,17 +3114,17 @@ dependencies = [
[[package]]
name = "mail-send"
-version = "0.4.1"
-source = "git+https://github.com/stalwartlabs/mail-send#53904ce6cf4fcb9a42a92a541f5d64d4d972d6cb"
+version = "0.4.2"
+source = "git+https://github.com/stalwartlabs/mail-send#09981bceec74b2da9522c3aaadcd675e612d1653"
dependencies = [
- "base64 0.20.0",
+ "base64 0.21.5",
"gethostname",
"md5",
"rustls 0.21.9",
"smtp-proto",
"tokio",
"tokio-rustls",
- "webpki-roots 0.25.3",
+ "webpki-roots 0.26.0",
]
[[package]]
@@ -3166,7 +3160,7 @@ dependencies = [
"md5",
"parking_lot",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"sieve-rs",
"store",
"tokio",
@@ -3354,7 +3348,7 @@ dependencies = [
"pin-project",
"rand",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"serde",
"serde_json",
"socket2 0.5.5",
@@ -3376,7 +3370,7 @@ checksum = "06f19e4cfa0ab5a76b627cec2d81331c49b034988eaf302c3bafeada684eadef"
dependencies = [
"base64 0.21.5",
"bigdecimal",
- "bindgen 0.65.1",
+ "bindgen 0.69.1",
"bitflags 2.4.1",
"bitvec",
"btoi",
@@ -4494,7 +4488,7 @@ dependencies = [
"percent-encoding",
"pin-project-lite",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"serde",
"serde_json",
"serde_urlencoded",
@@ -4555,9 +4549,9 @@ dependencies = [
[[package]]
name = "ring"
-version = "0.17.5"
+version = "0.17.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b"
+checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866"
dependencies = [
"cc",
"getrandom",
@@ -4617,9 +4611,9 @@ dependencies = [
[[package]]
name = "rocksdb"
-version = "0.20.1"
+version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99"
+checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe"
dependencies = [
"libc",
"librocksdb-sys",
@@ -4638,9 +4632,9 @@ dependencies = [
[[package]]
name = "rsa"
-version = "0.9.4"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a3211b01eea83d80687da9eef70e39d65144a3894866a5153a2723e425a157f"
+checksum = "af6c4b23d99685a1408194da11270ef8e9809aff951cc70ec9b17350b087e474"
dependencies = [
"const-oid",
"digest 0.10.7",
@@ -4780,15 +4774,15 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.25"
+version = "0.38.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e"
+checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a"
dependencies = [
"bitflags 2.4.1",
"errno",
"libc",
"linux-raw-sys",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -4810,7 +4804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9"
dependencies = [
"log",
- "ring 0.17.5",
+ "ring 0.17.6",
"rustls-webpki",
"sct",
]
@@ -4822,7 +4816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
dependencies = [
"openssl-probe",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"schannel",
"security-framework",
]
@@ -4836,13 +4830,29 @@ dependencies = [
"base64 0.21.5",
]
+[[package]]
+name = "rustls-pemfile"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4"
+dependencies = [
+ "base64 0.21.5",
+ "rustls-pki-types",
+]
+
+[[package]]
+name = "rustls-pki-types"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb0a1f9b9efec70d32e6d6aa3e58ebd88c3754ec98dfe9145c63cf54cc829b83"
+
[[package]]
name = "rustls-webpki"
version = "0.101.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
dependencies = [
- "ring 0.17.5",
+ "ring 0.17.6",
"untrusted 0.9.0",
]
@@ -4915,7 +4925,7 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
dependencies = [
- "ring 0.17.5",
+ "ring 0.17.6",
"untrusted 0.9.0",
]
@@ -5276,7 +5286,7 @@ dependencies = [
"regex",
"reqwest",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"serde",
"serde_json",
"sha1",
@@ -5359,9 +5369,9 @@ dependencies = [
[[package]]
name = "spki"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
+checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
dependencies = [
"base64ct",
"der",
@@ -5420,7 +5430,7 @@ dependencies = [
"paste",
"percent-encoding",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 1.0.4",
"serde",
"serde_json",
"sha2 0.10.8",
@@ -5629,7 +5639,6 @@ name = "store"
version = "0.1.0"
dependencies = [
"ahash 0.8.6",
- "async-trait",
"blake3",
"deadpool-postgres",
"farmhash",
@@ -5645,7 +5654,7 @@ dependencies = [
"r2d2",
"rand",
"rayon",
- "ring 0.17.5",
+ "ring 0.17.6",
"roaring",
"rocksdb",
"rusqlite",
@@ -5862,7 +5871,7 @@ dependencies = [
"rayon",
"reqwest",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 2.0.0",
"serde",
"serde_json",
"serial_test",
@@ -6488,7 +6497,7 @@ dependencies = [
"privdrop",
"rand",
"rustls 0.21.9",
- "rustls-pemfile",
+ "rustls-pemfile 2.0.0",
"serde",
"smtp-proto",
"tokio",
@@ -6498,7 +6507,7 @@ dependencies = [
"tracing-journald",
"tracing-opentelemetry",
"tracing-subscriber",
- "webpki-roots 0.25.3",
+ "webpki-roots 0.26.0",
]
[[package]]
@@ -6545,9 +6554,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.88"
+version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
+checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -6555,9 +6564,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.88"
+version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
+checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826"
dependencies = [
"bumpalo",
"log",
@@ -6570,9 +6579,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.38"
+version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02"
+checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12"
dependencies = [
"cfg-if",
"js-sys",
@@ -6582,9 +6591,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.88"
+version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
+checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -6592,9 +6601,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.88"
+version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
+checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
dependencies = [
"proc-macro2",
"quote",
@@ -6605,9 +6614,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.88"
+version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
+checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f"
[[package]]
name = "wasm-streams"
@@ -6624,9 +6633,9 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.65"
+version = "0.3.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85"
+checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -6648,7 +6657,7 @@ version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53"
dependencies = [
- "ring 0.17.5",
+ "ring 0.17.6",
"untrusted 0.9.0",
]
@@ -6676,6 +6685,15 @@ version = "0.25.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
+[[package]]
+name = "webpki-roots"
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188"
+dependencies = [
+ "rustls-pki-types",
+]
+
[[package]]
name = "whatlang"
version = "0.16.3"
@@ -6772,6 +6790,15 @@ dependencies = [
"windows-targets 0.48.5",
]
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.0",
+]
+
[[package]]
name = "windows-targets"
version = "0.42.2"
@@ -6802,6 +6829,21 @@ dependencies = [
"windows_x86_64_msvc 0.48.5",
]
+[[package]]
+name = "windows-targets"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.0",
+ "windows_aarch64_msvc 0.52.0",
+ "windows_i686_gnu 0.52.0",
+ "windows_i686_msvc 0.52.0",
+ "windows_x86_64_gnu 0.52.0",
+ "windows_x86_64_gnullvm 0.52.0",
+ "windows_x86_64_msvc 0.52.0",
+]
+
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
@@ -6814,6 +6856,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
+
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
@@ -6826,6 +6874,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
+
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
@@ -6838,6 +6892,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
+
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
@@ -6850,6 +6910,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
+
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
@@ -6862,6 +6928,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
+
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
@@ -6874,6 +6946,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
+
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
@@ -6886,6 +6964,12 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+
[[package]]
name = "winnow"
version = "0.5.19"
@@ -6965,18 +7049,18 @@ checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b"
[[package]]
name = "zerocopy"
-version = "0.7.26"
+version = "0.7.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0"
+checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.26"
+version = "0.7.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f"
+checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b"
dependencies = [
"proc-macro2",
"quote",
diff --git a/crates/jmap/src/lib.rs b/crates/jmap/src/lib.rs
index a85f0602..ea2eaa44 100644
--- a/crates/jmap/src/lib.rs
+++ b/crates/jmap/src/lib.rs
@@ -48,10 +48,7 @@ use services::{
};
use smtp::core::SMTP;
use store::{
- backend::{
- foundationdb::FdbStore, fs::FsStore, mysql::MysqlStore, postgres::PostgresStore,
- sqlite::SqliteStore,
- },
+ backend::rocksdb::RocksDbStore,
fts::FtsFilter,
parking_lot::Mutex,
query::{sort::Pagination, Comparator, Filter, ResultSet, SortedResultSet},
@@ -203,21 +200,26 @@ impl JMAP {
PostgresStore::open(config)
.await
.failed("Unable to open database"),
- ));
- let store = Store::SQLite(Arc::new(
+ ));*/
+ /*let store = Store::SQLite(Arc::new(
SqliteStore::open(config)
.await
.failed("Unable to open database"),
- ));
- let store = Store::FoundationDb(Arc::new(
+ ));*/
+ /*let store = Store::FoundationDb(Arc::new(
FdbStore::open(config)
.await
.failed("Unable to open database"),
));*/
- let store = Store::MySQL(Arc::new(
+ /*let store = Store::MySQL(Arc::new(
MysqlStore::open(config)
.await
.failed("Unable to open database"),
+ ));*/
+ let store = Store::RocksDb(Arc::new(
+ RocksDbStore::open(config)
+ .await
+ .failed("Unable to open database"),
));
let blob_store = store.clone().into();
/*let blob_store = BlobStore::Fs(Arc::new(
diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml
index 18f69818..562192c3 100644
--- a/crates/main/Cargo.toml
+++ b/crates/main/Cargo.toml
@@ -31,7 +31,10 @@ tracing = "0.1"
jemallocator = "0.5.0"
[features]
-default = ["sqlite", "foundationdb"]
+#default = ["sqlite", "foundationdb", "postgres", "mysql"]
+default = ["rocks"]
sqlite = ["store/sqlite"]
foundationdb = ["store/foundation"]
-
+postgres = ["store/postgres"]
+mysql = ["store/mysql"]
+rocks = ["store/rocks"]
diff --git a/crates/store/Cargo.toml b/crates/store/Cargo.toml
index 3ba3ce77..5c7c4e21 100644
--- a/crates/store/Cargo.toml
+++ b/crates/store/Cargo.toml
@@ -7,7 +7,7 @@ resolver = "2"
[dependencies]
utils = { path = "../utils" }
nlp = { path = "../nlp" }
-rocksdb = { version = "0.20.1", optional = true }
+rocksdb = { version = "0.21", optional = true, features = ["multi-threaded-cf"] }
foundationdb = { version = "0.8.0", features = ["embedded-fdb-include"], optional = true }
rusqlite = { version = "0.29.0", features = ["bundled"], optional = true }
rust-s3 = { version = "0.33.0", default-features = false, features = ["tokio-rustls-tls"] }
@@ -27,23 +27,24 @@ lru-cache = { version = "0.1.2", optional = true }
num_cpus = { version = "1.15.0", optional = true }
blake3 = "1.3.3"
tracing = "0.1"
-async-trait = "0.1.68"
lz4_flex = { version = "0.11" }
-deadpool-postgres = "0.11.0"
-tokio-postgres = "0.7.10"
-tokio-rustls = { version = "0.24.0"}
-rustls = "0.21.0"
-ring = "0.17"
-mysql_async = { version = "*", default-features = false, features = ["default-rustls"] }
+deadpool-postgres = { version = "0.11.0", optional = true }
+tokio-postgres = { version = "0.7.10", optional = true }
+tokio-rustls = { version = "0.24.0", optional = true }
+rustls = { version = "0.21.0", optional = true }
+ring = { version = "0.17", optional = true }
+mysql_async = { version = "0.33", default-features = false, features = ["default-rustls"], optional = true }
[dev-dependencies]
tokio = { version = "1.23", features = ["full"] }
[features]
-rocks = ["rocksdb", "rayon"]
+rocks = ["rocksdb", "rayon", "num_cpus"]
sqlite = ["rusqlite", "rayon", "r2d2", "num_cpus", "lru-cache"]
+postgres = ["tokio-postgres", "deadpool-postgres", "tokio-rustls", "rustls", "ring", "futures"]
+mysql = ["mysql_async"]
foundation = ["foundationdb", "futures"]
-backend = []
+
test_mode = []
diff --git a/crates/store/src/backend/mod.rs b/crates/store/src/backend/mod.rs
index 9ab4c108..5450623d 100644
--- a/crates/store/src/backend/mod.rs
+++ b/crates/store/src/backend/mod.rs
@@ -23,15 +23,18 @@
#[cfg(feature = "foundation")]
pub mod foundationdb;
-pub mod fs;
+#[cfg(feature = "mysql")]
pub mod mysql;
+#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "rocks")]
pub mod rocksdb;
-pub mod s3;
#[cfg(feature = "sqlite")]
pub mod sqlite;
+pub mod fs;
+pub mod s3;
+
pub const MAX_TOKEN_LENGTH: usize = (u8::MAX >> 1) as usize;
pub const MAX_TOKEN_MASK: usize = MAX_TOKEN_LENGTH - 1;
diff --git a/crates/store/src/backend/mysql/mod.rs b/crates/store/src/backend/mysql/mod.rs
index c307781c..b41f5b5c 100644
--- a/crates/store/src/backend/mysql/mod.rs
+++ b/crates/store/src/backend/mysql/mod.rs
@@ -27,7 +27,6 @@ pub mod blob;
pub mod main;
pub mod purge;
pub mod read;
-pub mod tls;
pub mod write;
pub struct MysqlStore {
diff --git a/crates/store/src/backend/mysql/tls.rs b/crates/store/src/backend/mysql/tls.rs
deleted file mode 100644
index 76805aeb..00000000
--- a/crates/store/src/backend/mysql/tls.rs
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2023 Stalwart Labs Ltd.
- *
- * This file is part of the Stalwart Mail Server.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- * in the LICENSE file at the top-level directory of this distribution.
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- * You can be released from the requirements of the AGPLv3 license by
- * purchasing a commercial license. Please contact licensing@stalw.art
- * for more details.
-*/
-
-// Credits: https://github.com/jbg/tokio-postgres-rustls
-
-use std::{
- convert::TryFrom,
- future::Future,
- io,
- pin::Pin,
- sync::Arc,
- task::{Context, Poll},
-};
-
-use futures::future::{FutureExt, TryFutureExt};
-use ring::digest;
-use rustls::{ClientConfig, ServerName};
-use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
-use tokio_postgres::tls::{ChannelBinding, MakeTlsConnect, TlsConnect};
-use tokio_rustls::{client::TlsStream, TlsConnector};
-
-#[derive(Clone)]
-pub struct MakeRustlsConnect {
- config: Arc,
-}
-
-impl MakeRustlsConnect {
- pub fn new(config: ClientConfig) -> Self {
- Self {
- config: Arc::new(config),
- }
- }
-}
-
-impl MakeTlsConnect for MakeRustlsConnect
-where
- S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
-{
- type Stream = RustlsStream;
- type TlsConnect = RustlsConnect;
- type Error = io::Error;
-
- fn make_tls_connect(&mut self, hostname: &str) -> io::Result {
- ServerName::try_from(hostname)
- .map(|dns_name| {
- RustlsConnect(Some(RustlsConnectData {
- hostname: dns_name,
- connector: Arc::clone(&self.config).into(),
- }))
- })
- .or(Ok(RustlsConnect(None)))
- }
-}
-
-pub struct RustlsConnect(Option);
-
-struct RustlsConnectData {
- hostname: ServerName,
- connector: TlsConnector,
-}
-
-impl TlsConnect for RustlsConnect
-where
- S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
-{
- type Stream = RustlsStream;
- type Error = io::Error;
- type Future = Pin>> + Send>>;
-
- fn connect(self, stream: S) -> Self::Future {
- match self.0 {
- None => Box::pin(core::future::ready(Err(io::ErrorKind::InvalidInput.into()))),
- Some(c) => c
- .connector
- .connect(c.hostname, stream)
- .map_ok(|s| RustlsStream(Box::pin(s)))
- .boxed(),
- }
- }
-}
-
-pub struct RustlsStream(Pin>>);
-
-impl tokio_postgres::tls::TlsStream for RustlsStream
-where
- S: AsyncRead + AsyncWrite + Unpin,
-{
- fn channel_binding(&self) -> ChannelBinding {
- let (_, session) = self.0.get_ref();
- match session.peer_certificates() {
- Some(certs) if !certs.is_empty() => {
- let sha256 = digest::digest(&digest::SHA256, certs[0].as_ref());
- ChannelBinding::tls_server_end_point(sha256.as_ref().into())
- }
- _ => ChannelBinding::none(),
- }
- }
-}
-
-impl AsyncRead for RustlsStream
-where
- S: AsyncRead + AsyncWrite + Unpin,
-{
- fn poll_read(
- mut self: Pin<&mut Self>,
- cx: &mut Context,
- buf: &mut ReadBuf<'_>,
- ) -> Poll> {
- self.0.as_mut().poll_read(cx, buf)
- }
-}
-
-impl AsyncWrite for RustlsStream
-where
- S: AsyncRead + AsyncWrite + Unpin,
-{
- fn poll_write(
- mut self: Pin<&mut Self>,
- cx: &mut Context,
- buf: &[u8],
- ) -> Poll> {
- self.0.as_mut().poll_write(cx, buf)
- }
-
- fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> {
- self.0.as_mut().poll_flush(cx)
- }
-
- fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> {
- self.0.as_mut().poll_shutdown(cx)
- }
-}
diff --git a/crates/store/src/backend/rocksdb/bitmap.rs b/crates/store/src/backend/rocksdb/bitmap.rs
index c88aafcf..8cf956cf 100644
--- a/crates/store/src/backend/rocksdb/bitmap.rs
+++ b/crates/store/src/backend/rocksdb/bitmap.rs
@@ -25,6 +25,8 @@ use crate::{Deserialize, Serialize};
use roaring::RoaringBitmap;
use utils::codec::leb128::{Leb128Iterator, Leb128Vec};
+use crate::U32_LEN;
+
pub const BIT_SET: u8 = 0x80;
pub const BIT_CLEAR: u8 = 0;
@@ -61,15 +63,22 @@ pub fn deserialize_bitmap(bytes: &[u8]) -> Option {
}
impl Deserialize for RoaringBitmap {
- fn deserialize(bytes: &[u8]) -> Option {
- match *bytes.first()? {
- IS_BITMAP => deserialize_bitmap(bytes),
+ fn deserialize(bytes: &[u8]) -> crate::Result {
+ match *bytes
+ .first()
+ .ok_or_else(|| crate::Error::InternalError("Empty bitmap".to_string()))?
+ {
+ IS_BITMAP => deserialize_bitmap(bytes).ok_or_else(|| {
+ crate::Error::InternalError("Failed to deserialize bitmap".to_string())
+ }),
IS_BITLIST => {
let mut bm = RoaringBitmap::new();
deserialize_bitlist(&mut bm, bytes);
- Some(bm)
+ Ok(bm)
}
- _ => None,
+ _ => Err(crate::Error::InternalError(
+ "Invalid bitmap type".to_string(),
+ )),
}
}
}
@@ -201,7 +210,7 @@ pub fn bitmap_merge<'x>(
operands: impl IntoIterator- ,
) -> Option> {
let mut bm = match existing_val {
- Some(existing_val) => RoaringBitmap::deserialize(existing_val)?,
+ Some(existing_val) => RoaringBitmap::deserialize(existing_val).ok()?,
None if operands_len == 1 => {
return Some(Vec::from(operands.into_iter().next().unwrap()));
}
diff --git a/crates/store/src/backend/rocksdb/blob.rs b/crates/store/src/backend/rocksdb/blob.rs
new file mode 100644
index 00000000..5022d2ba
--- /dev/null
+++ b/crates/store/src/backend/rocksdb/blob.rs
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2023 Stalwart Labs Ltd.
+ *
+ * This file is part of the Stalwart Mail Server.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ * in the LICENSE file at the top-level directory of this distribution.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ *
+ * You can be released from the requirements of the AGPLv3 license by
+ * purchasing a commercial license. Please contact licensing@stalw.art
+ * for more details.
+*/
+
+use std::ops::Range;
+
+use super::{RocksDbStore, CF_BLOB_DATA};
+
+impl RocksDbStore {
+ pub(crate) async fn get_blob(
+ &self,
+ key: &[u8],
+ range: Range,
+ ) -> crate::Result