diff --git a/Cargo.lock b/Cargo.lock index ec6945c8..1837fe3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,9 +120,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c900954614442c827787a2ffcd8c0602eb53ff7b95a8fbfcdaf5e406197bf3be" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" @@ -600,7 +600,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -923,9 +923,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.23.2" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" [[package]] name = "byteorder" @@ -1017,9 +1017,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.39" +version = "1.2.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1354349954c6fc9cb0deab020f27f783cf0b604e8bb754dc4658ecf0d29c35f" +checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" dependencies = [ "find-msvc-tools", "jobserver", @@ -1095,7 +1095,7 @@ dependencies = [ "pure-rust-locales", "serde", "wasm-bindgen", - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -1221,7 +1221,7 @@ dependencies = [ [[package]] name = "common" -version = "0.13.4" +version = "0.14.0" dependencies = [ "aes-gcm-siv", "ahash", @@ -1346,7 +1346,7 @@ dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.1", + "unicode-width 0.2.2", "windows-sys 0.59.0", ] @@ -1378,9 +1378,9 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" dependencies = [ "const_format_proc_macros", ] @@ -1762,7 +1762,7 @@ checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "dav" -version = "0.13.4" +version = "0.14.0" dependencies = [ "calcard", "chrono", @@ -1784,7 +1784,7 @@ dependencies = [ [[package]] name = "dav-proto" -version = "0.13.4" +version = "0.14.0" dependencies = [ "calcard", "chrono", @@ -1868,9 +1868,9 @@ dependencies = [ [[package]] name = "deflate64" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" +checksum = "26bf8fc351c5ed29b5c2f0cbbac1b209b74f60ecd62e675a998df72c49af5204" [[package]] name = "der" @@ -1978,7 +1978,7 @@ dependencies = [ [[package]] name = "directory" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "argon2", @@ -2045,7 +2045,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -2251,7 +2251,7 @@ dependencies = [ [[package]] name = "email" -version = "0.13.4" +version = "0.14.0" dependencies = [ "aes", "aes-gcm", @@ -2339,7 +2339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -2371,7 +2371,7 @@ dependencies = [ [[package]] name = "event_macro" -version = "0.13.4" +version = "0.14.0" dependencies = [ "proc-macro2", "quote", @@ -2464,9 +2464,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "find-msvc-tools" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" [[package]] name = "fixedbitset" @@ -2476,9 +2476,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" dependencies = [ "crc32fast", "libz-rs-sys", @@ -2736,9 +2736,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c8444bc9d71b935156cc0ccab7f622180808af7867b1daae6547d773591703" +checksum = "56cf091b3dc50a299896cb5fb7d9d1908500766a5de99a8d515e63cb4251de8f" dependencies = [ "typenum", ] @@ -2846,7 +2846,7 @@ dependencies = [ [[package]] name = "groupware" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "calcard", @@ -3145,7 +3145,7 @@ dependencies = [ [[package]] name = "http" -version = "0.13.4" +version = "0.14.0" dependencies = [ "async-stream", "base64 0.22.1", @@ -3256,7 +3256,7 @@ dependencies = [ [[package]] name = "http_proto" -version = "0.13.4" +version = "0.14.0" dependencies = [ "common", "compact_str", @@ -3369,7 +3369,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] @@ -3563,7 +3563,7 @@ checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c" [[package]] name = "imap" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "common", @@ -3590,7 +3590,7 @@ dependencies = [ [[package]] name = "imap_proto" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "chrono", @@ -3672,7 +3672,7 @@ dependencies = [ "console", "number_prefix", "portable-atomic", - "unicode-width 0.2.1", + "unicode-width 0.2.2", "web-time", ] @@ -3862,7 +3862,7 @@ dependencies = [ [[package]] name = "jmap" -version = "0.13.4" +version = "0.14.0" dependencies = [ "aes-gcm", "aes-gcm-siv", @@ -3938,7 +3938,9 @@ dependencies = [ [[package]] name = "jmap-tools" -version = "0.1.2" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6ea6b2f1d3b2c7c53dfa4fc7bf2bc2a419fb30920849a01300dabeac9493013" dependencies = [ "hashify", "rkyv", @@ -3948,7 +3950,7 @@ dependencies = [ [[package]] name = "jmap_proto" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "calcard", @@ -4150,9 +4152,9 @@ checksum = "2c4a545a15244c7d945065b5d392b2d2d7f21526fba56ce51467b06ed445e8f7" [[package]] name = "libc" -version = "0.2.176" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libflate" @@ -4185,7 +4187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -4292,11 +4294,10 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] @@ -4418,12 +4419,12 @@ dependencies = [ "smtp-proto", "tokio", "tokio-rustls 0.26.4", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] name = "managesieve" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "common", @@ -4532,7 +4533,7 @@ checksum = "c797b9d6bb23aab2fc369c65f871be49214f5c759af65bde26ffaaa2b646b492" [[package]] name = "migration" -version = "0.13.4" +version = "0.14.0" dependencies = [ "base64 0.22.1", "bincode 1.3.3", @@ -4588,6 +4589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -4769,7 +4771,7 @@ dependencies = [ [[package]] name = "nlp" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "bincode 1.3.3", @@ -4824,11 +4826,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.50.1" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5201,9 +5203,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -5211,15 +5213,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -5253,12 +5255,12 @@ dependencies = [ [[package]] name = "pem" -version = "3.0.5" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ "base64 0.22.1", - "serde", + "serde_core", ] [[package]] @@ -5278,20 +5280,19 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" +checksum = "989e7521a040efde50c3ab6bbadafbe15ab6dc042686926be59ac35d74607df4" dependencies = [ "memchr", - "thiserror 2.0.17", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc58706f770acb1dbd0973e6530a3cff4746fb721207feb3a8a6064cd0b6c663" +checksum = "187da9a3030dbafabbbfb20cb323b976dc7b7ce91fcd84f2f74d6e31d378e2de" dependencies = [ "pest", "pest_generator", @@ -5299,9 +5300,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d4f36811dfe07f7b8573462465d5cb8965fffc2e71ae377a33aecf14c2c9a2f" +checksum = "49b401d98f5757ebe97a26085998d6c0eecec4995cad6ab7fc30ffdf4b052843" dependencies = [ "pest", "pest_meta", @@ -5312,9 +5313,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42919b05089acbd0a5dcd5405fb304d17d1053847b81163d09c4ad18ce8e8420" +checksum = "72f27a2cfee9f9039c4d86faa5af122a0ac3851441a34865b8a043b46be0065a" dependencies = [ "pest", "sha2 0.10.9", @@ -5534,7 +5535,7 @@ dependencies = [ [[package]] name = "pop3" -version = "0.13.4" +version = "0.14.0" dependencies = [ "common", "directory", @@ -5577,9 +5578,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a120daaabfcb0e324d5bf6e411e9222994cb3795c79943a0ef28ed27ea76e4" +checksum = "ef4605b7c057056dd35baeb6ac0c0338e4975b1f2bef0f65da953285eb007095" dependencies = [ "bytes", "fallible-iterator 0.2.0", @@ -5731,7 +5732,7 @@ dependencies = [ [[package]] name = "proc_macros" -version = "0.13.4" +version = "0.14.0" dependencies = [ "proc-macro2", "quote", @@ -5787,9 +5788,9 @@ dependencies = [ [[package]] name = "psl" -version = "2.1.145" +version = "2.1.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bc7bed4cdf5168c58514ad64f37615f6683882209e2b6ba345cda0c6b8d949" +checksum = "53297a72c400b31c5facd8e50894d08d20b74ee74925b28a20d51fe48c863583" dependencies = [ "psl-types", ] @@ -5872,13 +5873,13 @@ dependencies = [ [[package]] name = "quick_cache" -version = "0.6.16" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad6644cb07b7f3488b9f3d2fde3b4c0a7fa367cafefb39dff93a659f76eb786" +checksum = "ba15f5bccfb18c666351668b97bbff66da5093f96757ca15299e4e594fe1316e" dependencies = [ "ahash", "equivalent", - "hashbrown 0.15.5", + "hashbrown 0.16.0", "parking_lot", ] @@ -6224,9 +6225,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.32.6" +version = "0.32.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15965fbccb975c38a08a68beca6bdb57da9081cd0859417c5975a160d968c3cb" +checksum = "014cc767fefab6a3e798ca45112bccad9c6e0e218fbd49720042716c73cfef44" dependencies = [ "bytes", "cfg-if", @@ -6249,14 +6250,14 @@ dependencies = [ "tokio-rustls 0.26.4", "tokio-util", "url", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] name = "redox_syscall" -version = "0.5.17" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags 2.9.4", ] @@ -6305,9 +6306,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.3" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" +checksum = "4a52d8d02cacdb176ef4678de6c052efb4b3da14b78e4db683a4252762be5433" dependencies = [ "aho-corasick", "memchr", @@ -6317,9 +6318,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" +checksum = "722166aa0d7438abbaa4d5cc2c649dac844e8c56d82fb3d33e9c34b5cd268fc6" dependencies = [ "aho-corasick", "memchr", @@ -6328,9 +6329,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" +checksum = "c3160422bbd54dd5ecfdca71e5fd59b7b8fe2b1697ab2baf64f6d05dcc66d298" [[package]] name = "rend" @@ -6425,7 +6426,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] @@ -6742,7 +6743,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -6767,7 +6768,7 @@ dependencies = [ "once_cell", "ring 0.17.14", "rustls-pki-types", - "rustls-webpki 0.103.6", + "rustls-webpki 0.103.7", "subtle", "zeroize", ] @@ -6851,7 +6852,7 @@ dependencies = [ "rustls 0.23.32", "rustls-native-certs 0.8.1", "rustls-platform-verifier-android", - "rustls-webpki 0.103.6", + "rustls-webpki 0.103.7", "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", @@ -6887,9 +6888,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.6" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring 0.17.14", "rustls-pki-types", @@ -6947,7 +6948,7 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -7301,9 +7302,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c522100790450cf78eeac1507263d0a350d4d5b30df0c8e1fe051a10c22b376e" +checksum = "6093cd8c01b25262b84927e0f7151692158fab02d961e04c979d3903eba7ecc5" dependencies = [ "base64 0.22.1", "chrono", @@ -7312,10 +7313,9 @@ dependencies = [ "indexmap 2.11.4", "schemars 0.9.0", "schemars 1.0.4", - "serde", - "serde_derive", + "serde_core", "serde_json", - "serde_with_macros 3.14.1", + "serde_with_macros 3.15.0", "time", ] @@ -7333,9 +7333,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327ada00f7d64abaac1e55a6911e90cf665aa051b9a561c7006c157f4633135e" +checksum = "a7e6c180db0816026a61afa1cff5344fb7ebded7e4d3062772179f2501481c27" dependencies = [ "darling 0.21.3", "proc-macro2", @@ -7383,7 +7383,7 @@ dependencies = [ [[package]] name = "services" -version = "0.13.4" +version = "0.14.0" dependencies = [ "aes-gcm", "aes-gcm-siv", @@ -7453,7 +7453,7 @@ checksum = "1f606421e4a6012877e893c399822a4ed4b089164c5969424e1b9d1e66e6964b" dependencies = [ "const-oid", "digest 0.10.7", - "generic-array 1.2.0", + "generic-array 1.3.0", ] [[package]] @@ -7593,7 +7593,7 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smtp" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "blake3", @@ -7636,7 +7636,7 @@ dependencies = [ "trc", "types", "utils", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", "x509-parser 0.17.0", ] @@ -7695,7 +7695,7 @@ dependencies = [ [[package]] name = "spam-filter" -version = "0.13.4" +version = "0.14.0" dependencies = [ "common", "compact_str", @@ -7753,20 +7753,20 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stalwart" -version = "0.13.4" +version = "0.14.0" dependencies = [ "common", "dav", "directory", "email", "groupware", - "http 0.13.4", + "http 0.14.0", "imap", "jemallocator", "jmap", @@ -7785,7 +7785,7 @@ dependencies = [ [[package]] name = "stalwart-cli" -version = "0.13.4" +version = "0.14.0" dependencies = [ "clap", "console", @@ -7816,7 +7816,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "store" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "arc-swap", @@ -8025,7 +8025,7 @@ dependencies = [ [[package]] name = "tests" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "async-trait", @@ -8046,7 +8046,7 @@ dependencies = [ "form_urlencoded", "futures", "groupware", - "http 0.13.4", + "http 0.14.0", "http-body-util", "http_proto", "hyper 1.7.0", @@ -8259,9 +8259,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156efe7fff213168257853e1dfde202eed5f487522cbbbf7d219941d753d853" +checksum = "2b40d66d9b2cfe04b628173409368e58247e8eddbbd3b0e6c6ba1d09f20f6c9e" dependencies = [ "async-trait", "byteorder", @@ -8367,18 +8367,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.6" +version = "0.23.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" dependencies = [ "indexmap 2.11.4", "toml_datetime", @@ -8388,9 +8388,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" dependencies = [ "winnow", ] @@ -8581,7 +8581,7 @@ dependencies = [ [[package]] name = "trc" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "base64 0.22.1", @@ -8656,13 +8656,13 @@ checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "types" -version = "0.13.4" +version = "0.14.0" dependencies = [ "blake3", "compact_str", @@ -8697,9 +8697,9 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uhlc" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66bbb93b0c2258fe1e81a84d8de5391f2577b039decabf75a6441ea1ebbf4cb5" +checksum = "b62a645e3e4e6c85b7abe49b086aa3204119431f42b6123b0070419fb6e9d24e" dependencies = [ "humantime", "lazy_static", @@ -8766,9 +8766,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -8859,7 +8859,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utils" -version = "0.13.4" +version = "0.14.0" dependencies = [ "ahash", "base64 0.22.1", @@ -8892,7 +8892,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.4", "trc", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", "x509-parser 0.17.0", ] @@ -9137,9 +9137,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4ffd8df1c57e87c325000a3d6ef93db75279dc3a231125aac571650f22b12a" +checksum = "05d651ec480de84b762e7be71e6efa7461699c19d9e2c272c8d93455f567786e" dependencies = [ "rustls-pki-types", ] @@ -9156,14 +9156,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" dependencies = [ "rustls-pki-types", ] @@ -9191,9 +9191,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" [[package]] name = "winapi" @@ -9217,7 +9217,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -9228,22 +9228,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.62.1" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6844ee5416b285084d3d3fffd743b925a6c9385455f64f6d4fa3031c4c2749a9" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.2.0", + "windows-link 0.2.1", "windows-result", "windows-strings", ] [[package]] name = "windows-implement" -version = "0.60.1" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb307e42a74fb6de9bf3a02d9712678b22399c87e6fa869d6dfcd8c1b7754e0" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -9252,9 +9252,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.2" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0abd1ddbc6964ac14db11c7213d6532ef34bd9aa042c2e5935f59d7908b46a5" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -9269,26 +9269,26 @@ checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-link" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-result" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] name = "windows-strings" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -9333,16 +9333,16 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.4", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.61.1" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -9393,19 +9393,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.4" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.0", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -9428,9 +9428,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -9452,9 +9452,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -9476,9 +9476,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -9488,9 +9488,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -9512,9 +9512,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -9536,9 +9536,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -9560,9 +9560,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -9584,9 +9584,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" @@ -9828,7 +9828,7 @@ dependencies = [ "secrecy", "serde", "serde_json", - "serde_with 3.14.1", + "serde_with 3.15.0", "serde_yaml", "tracing", "uhlc", @@ -10230,9 +10230,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index a2025035..e6de0186 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stalwart Labs LLC "] license = "AGPL-3.0-only OR LicenseRef-SEL" repository = "https://github.com/stalwartlabs/cli" homepage = "https://github.com/stalwartlabs/cli" -version = "0.13.4" +version = "0.14.0" edition = "2024" readme = "README.md" resolver = "2" diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 49e80942..5bfdb106 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" build = "build.rs" diff --git a/crates/dav-proto/Cargo.toml b/crates/dav-proto/Cargo.toml index 2010cd7a..85d1103e 100644 --- a/crates/dav-proto/Cargo.toml +++ b/crates/dav-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dav-proto" -version = "0.13.4" +version = "0.14.0" edition = "2021" [dependencies] diff --git a/crates/dav/Cargo.toml b/crates/dav/Cargo.toml index c444459a..bbc8a91c 100644 --- a/crates/dav/Cargo.toml +++ b/crates/dav/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dav" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/dav/src/card/mkcol.rs b/crates/dav/src/card/mkcol.rs index 78a1132a..70756758 100644 --- a/crates/dav/src/card/mkcol.rs +++ b/crates/dav/src/card/mkcol.rs @@ -18,7 +18,10 @@ use dav_proto::{ RequestHeaders, Return, schema::{Namespace, request::MkCol, response::MkColResponse}, }; -use groupware::{cache::GroupwareCache, contact::AddressBook}; +use groupware::{ + cache::GroupwareCache, + contact::{AddressBook, AddressBookPreferences}, +}; use http_proto::HttpResponse; use hyper::StatusCode; use store::write::BatchBuilder; @@ -82,6 +85,11 @@ impl CardMkColRequestHandler for Server { // Build file container let mut book = AddressBook { name: name.to_string(), + preferences: vec![AddressBookPreferences { + account_id, + name: "Address Book".to_string(), + ..Default::default() + }], ..Default::default() }; diff --git a/crates/dav/src/card/proppatch.rs b/crates/dav/src/card/proppatch.rs index 36fb8313..114d5571 100644 --- a/crates/dav/src/card/proppatch.rs +++ b/crates/dav/src/card/proppatch.rs @@ -442,10 +442,10 @@ fn remove_addressbook_properties( book.preferences_mut(access_token).description = None; items.insert_with_status(property, StatusCode::NO_CONTENT); } - /*DavProperty::WebDav(WebDavProperty::DisplayName) => { - book.display_name = None; + DavProperty::WebDav(WebDavProperty::DisplayName) => { + book.preferences_mut(access_token).name.clear(); items.insert_with_status(property, StatusCode::NO_CONTENT); - }*/ + } DavProperty::DeadProperty(dead) => { book.dead_properties.remove_element(dead); items.insert_with_status(property, StatusCode::NO_CONTENT); diff --git a/crates/directory/Cargo.toml b/crates/directory/Cargo.toml index ebb84f3f..794bb131 100644 --- a/crates/directory/Cargo.toml +++ b/crates/directory/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "directory" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/email/Cargo.toml b/crates/email/Cargo.toml index f44a13e2..04f85cf0 100644 --- a/crates/email/Cargo.toml +++ b/crates/email/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "email" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/email/src/sieve/delete.rs b/crates/email/src/sieve/delete.rs index 3818c75a..f4ae430b 100644 --- a/crates/email/src/sieve/delete.rs +++ b/crates/email/src/sieve/delete.rs @@ -13,8 +13,9 @@ use types::{collection::Collection, field::SieveField}; pub trait SieveScriptDelete: Sync + Send { fn sieve_script_delete( &self, - access_token: &AccessToken, + account_id: u32, document_id: u32, + access_token: &AccessToken, batch: &mut BatchBuilder, ) -> impl Future> + Send; } @@ -22,12 +23,12 @@ pub trait SieveScriptDelete: Sync + Send { impl SieveScriptDelete for Server { async fn sieve_script_delete( &self, - access_token: &AccessToken, + account_id: u32, document_id: u32, + access_token: &AccessToken, batch: &mut BatchBuilder, ) -> trc::Result { // Fetch record - let account_id = access_token.primary_id(); if let Some(obj_) = self .get_archive(account_id, Collection::SieveScript, document_id) .await? diff --git a/crates/email/src/sieve/ingest.rs b/crates/email/src/sieve/ingest.rs index 28fc4477..c6d75b50 100644 --- a/crates/email/src/sieve/ingest.rs +++ b/crates/email/src/sieve/ingest.rs @@ -77,7 +77,7 @@ pub trait SieveScriptIngest: Sync + Send { &self, account_id: u32, document_id: u32, - ) -> impl Future> + Send; + ) -> impl Future>> + Send; } impl SieveScriptIngest for Server { @@ -586,14 +586,16 @@ impl SieveScriptIngest for Server { .await .caused_by(trc::location!())? { - let script = self.sieve_script_compile(account_id, document_id).await?; - - Ok(Some(ActiveScript { - document_id, - script: Arc::new(script.script), - script_name: script.name, - version: script.version, - })) + if let Some(script) = self.sieve_script_compile(account_id, document_id).await? { + Ok(Some(ActiveScript { + document_id, + script: Arc::new(script.script), + script_name: script.name, + version: script.version, + })) + } else { + Ok(None) + } } else { Ok(None) } @@ -619,7 +621,7 @@ impl SieveScriptIngest for Server { { self.sieve_script_compile(account_id, document_id) .await - .map(|script| Some(script.script)) + .map(|script| script.map(|s| s.script)) } else { Ok(None) } @@ -630,17 +632,14 @@ impl SieveScriptIngest for Server { &self, account_id: u32, document_id: u32, - ) -> trc::Result { + ) -> trc::Result> { // Obtain script object - let script_object = self + let Some(script_object) = self .get_archive(account_id, Collection::SieveScript, document_id) .await? - .ok_or_else(|| { - trc::StoreEvent::NotFound - .into_err() - .caused_by(trc::location!()) - .document_id(document_id) - })?; + else { + return Ok(None); + }; // Obtain the sieve script length let version = script_object.version; @@ -671,11 +670,11 @@ impl SieveScriptIngest for Server { .deserialize::() .ok() }) { - Ok(CompiledScript { + Ok(Some(CompiledScript { script, name: unarchived_script.name.as_str().into(), version, - }) + })) } else { // Deserialization failed, probably because the script compiler version changed match self.core.sieve.untrusted_compiler.compile( @@ -729,11 +728,11 @@ impl SieveScriptIngest for Server { .await .caused_by(trc::location!())?; - Ok(CompiledScript { + Ok(Some(CompiledScript { script: sieve.into_inner(), name: new_archive.into_inner().name, version, - }) + })) } Err(error) => Err(trc::StoreEvent::UnexpectedError .caused_by(trc::location!()) diff --git a/crates/groupware/Cargo.toml b/crates/groupware/Cargo.toml index a50a9358..4df01265 100644 --- a/crates/groupware/Cargo.toml +++ b/crates/groupware/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "groupware" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/http-proto/Cargo.toml b/crates/http-proto/Cargo.toml index a3f14b51..da7429d1 100644 --- a/crates/http-proto/Cargo.toml +++ b/crates/http-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "http_proto" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/http/Cargo.toml b/crates/http/Cargo.toml index 6e02efed..a86cab02 100644 --- a/crates/http/Cargo.toml +++ b/crates/http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "http" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/imap-proto/Cargo.toml b/crates/imap-proto/Cargo.toml index 40424fdd..ebfdec55 100644 --- a/crates/imap-proto/Cargo.toml +++ b/crates/imap-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imap_proto" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/imap/Cargo.toml b/crates/imap/Cargo.toml index ee428aac..cede899e 100644 --- a/crates/imap/Cargo.toml +++ b/crates/imap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imap" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/jmap-proto/Cargo.toml b/crates/jmap-proto/Cargo.toml index a36fd069..3c60e4df 100644 --- a/crates/jmap-proto/Cargo.toml +++ b/crates/jmap-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jmap_proto" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" @@ -9,7 +9,7 @@ store = { path = "../store" } utils = { path = "../utils" } types = { path = "../types" } trc = { path = "../trc" } -jmap-tools = { path = "/Users/me/code/jmap-tool" } +jmap-tools = { version = "0.1" } calcard = { path = "/Users/me/code/calcard" } mail-parser = { version = "0.11", features = ["full_encoding", "rkyv"] } serde = { version = "1.0", features = ["derive"]} diff --git a/crates/jmap/Cargo.toml b/crates/jmap/Cargo.toml index 6eca082b..e16ce611 100644 --- a/crates/jmap/Cargo.toml +++ b/crates/jmap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jmap" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" @@ -26,7 +26,7 @@ mail-builder = { version = "0.4" } mail-send = { version = "0.5", default-features = false, features = ["cram-md5", "ring", "tls12"] } mail-auth = { version = "0.7.1", features = ["generate"] } sieve-rs = { version = "0.7", features = ["rkyv"] } -jmap-tools = { path = "/Users/me/code/jmap-tool", features = ["rkyv"] } +jmap-tools = { version = "0.1", features = ["rkyv"] } serde = { version = "1.0", features = ["derive"]} serde_json = "1.0" hyper = { version = "1.0.1", features = ["server", "http1", "http2"] } diff --git a/crates/jmap/src/api/session.rs b/crates/jmap/src/api/session.rs index 66929892..8b14e42e 100644 --- a/crates/jmap/src/api/session.rs +++ b/crates/jmap/src/api/session.rs @@ -6,7 +6,9 @@ use common::{Server, auth::AccessToken}; use directory::Permission; -use jmap_proto::request::capability::{Account, Capability, Session}; +use jmap_proto::request::capability::{ + Account, Capabilities, Capability, EmptyCapabilities, Session, +}; use std::future::Future; use std::sync::Arc; use trc::AddContext; @@ -35,23 +37,19 @@ impl SessionHandler for Server { session.username = access_token.name.to_string(); let account_id = Id::from(access_token.primary_id()); let mut account = Account { - name: access_token - .description - .as_ref() - .unwrap_or(&access_token.name) - .to_string(), + name: access_token.name.to_string(), is_personal: true, is_read_only: false, account_capabilities: VecMap::with_capacity(account_capabilities.len()), }; - for capability in access_token.capabilities() { + for capability in access_token.account_capabilities() { session.primary_accounts.append(capability, account_id); account.account_capabilities.append( capability, account_capabilities .get(&capability) - .unwrap() - .to_account_capabilities(account_id.into(), true), + .map(|v| v.to_account_capabilities(account_id.into(), true)) + .unwrap_or_else(|| Capabilities::Empty(EmptyCapabilities::default())), ); } session.accounts.append(account_id, account); @@ -66,23 +64,18 @@ impl SessionHandler for Server { let account_id = Id::from(account_id); let mut account = Account { - name: access_token - .description - .as_ref() - .unwrap_or(&access_token.name) - .to_string(), + name: access_token.name.to_string(), is_personal: false, is_read_only: false, account_capabilities: VecMap::with_capacity(account_capabilities.len()), }; - for capability in access_token.capabilities() { - session.primary_accounts.append(capability, account_id); + for capability in access_token.account_capabilities() { account.account_capabilities.append( capability, account_capabilities .get(&capability) - .unwrap() - .to_account_capabilities(account_id.into(), is_owner), + .map(|v| v.to_account_capabilities(account_id.into(), is_owner)) + .unwrap_or_else(|| Capabilities::Empty(EmptyCapabilities::default())), ); } session.accounts.append(account_id, account); @@ -93,11 +86,11 @@ impl SessionHandler for Server { } trait AccountCapabilities { - fn capabilities(&self) -> impl Iterator; + fn account_capabilities(&self) -> impl Iterator; } impl AccountCapabilities for AccessToken { - fn capabilities(&self) -> impl Iterator { + fn account_capabilities(&self) -> impl Iterator { Capability::all_capabilities() .iter() .filter(move |capability| { @@ -113,11 +106,10 @@ impl AccountCapabilities for AccessToken { Capability::Blob => Permission::JmapBlobGet, Capability::Quota => Permission::JmapQuotaGet, Capability::FileNode => Permission::JmapFileNodeGet, - Capability::Core - | Capability::WebSocket + Capability::WebSocket | Capability::Principals | Capability::PrincipalsAvailability => return true, - Capability::PrincipalsOwner => return false, + Capability::Core | Capability::PrincipalsOwner => return false, }; self.has_permission(permission) }) diff --git a/crates/jmap/src/sieve/set.rs b/crates/jmap/src/sieve/set.rs index 30489d69..d6b69e37 100644 --- a/crates/jmap/src/sieve/set.rs +++ b/crates/jmap/src/sieve/set.rs @@ -296,7 +296,7 @@ impl SieveScriptSet for Server { if sieve_ids.contains(document_id) { if active_script_id != Some(document_id) { if self - .sieve_script_delete(ctx.access_token, document_id, &mut batch) + .sieve_script_delete(account_id, document_id, ctx.access_token, &mut batch) .await? { ctx.response.destroyed.push(id); diff --git a/crates/jmap/src/vacation/set.rs b/crates/jmap/src/vacation/set.rs index fceb0215..e88d9e20 100644 --- a/crates/jmap/src/vacation/set.rs +++ b/crates/jmap/src/vacation/set.rs @@ -127,6 +127,7 @@ impl VacationResponseSet for Server { .with_collection(Collection::SieveScript); // Process changes + let active_script_id = self.sieve_script_get_active_id(account_id).await?; if let Some(changes) = changes { // Obtain current script let document_id = self.get_vacation_sieve_script_id(account_id).await?; @@ -284,10 +285,10 @@ impl VacationResponseSet for Server { .await? .hash; }; + batch.custom(obj).caused_by(trc::location!())?; // Deactivate other sieve scripts - let was_active = - self.sieve_script_get_active_id(account_id).await? == Some(document_id); + let was_active = active_script_id == Some(document_id); if is_active { if !was_active { batch @@ -303,7 +304,6 @@ impl VacationResponseSet for Server { } // Write changes - batch.custom(obj).caused_by(trc::location!())?; if !batch.is_empty() { response.new_state = Some( self.commit_batch(batch) @@ -330,10 +330,17 @@ impl VacationResponseSet for Server { if id.is_singleton() && let Some(document_id) = self.get_vacation_sieve_script_id(account_id).await? { - self.sieve_script_delete(access_token, document_id, &mut batch) + self.sieve_script_delete(account_id, document_id, access_token, &mut batch) .await?; + if active_script_id == Some(document_id) { + batch + .with_collection(Collection::Principal) + .update_document(0) + .clear(PrincipalField::ActiveScriptId); + } + response.destroyed.push(id); - continue; + break; } response.not_destroyed.append(id, SetError::not_found()); diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml index 1ca91119..395c1ae2 100644 --- a/crates/main/Cargo.toml +++ b/crates/main/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://stalw.art" keywords = ["imap", "jmap", "smtp", "email", "mail", "webdav", "server"] categories = ["email"] license = "AGPL-3.0-only OR LicenseRef-SEL" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/managesieve/Cargo.toml b/crates/managesieve/Cargo.toml index 4533d6ef..ef896f8b 100644 --- a/crates/managesieve/Cargo.toml +++ b/crates/managesieve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "managesieve" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/managesieve/src/op/deletescript.rs b/crates/managesieve/src/op/deletescript.rs index 25e49d06..219d8e5a 100644 --- a/crates/managesieve/src/op/deletescript.rs +++ b/crates/managesieve/src/op/deletescript.rs @@ -40,7 +40,7 @@ impl Session { if active_script_id != Some(document_id) { if self .server - .sieve_script_delete(access_token, document_id, &mut batch) + .sieve_script_delete(account_id, document_id, access_token, &mut batch) .await .caused_by(trc::location!())? { diff --git a/crates/migration/Cargo.toml b/crates/migration/Cargo.toml index 1ca08b98..caafba0b 100644 --- a/crates/migration/Cargo.toml +++ b/crates/migration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "migration" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/nlp/Cargo.toml b/crates/nlp/Cargo.toml index 49c056b1..b02ccd7a 100644 --- a/crates/nlp/Cargo.toml +++ b/crates/nlp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nlp" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/pop3/Cargo.toml b/crates/pop3/Cargo.toml index 2f95fd64..4693c86b 100644 --- a/crates/pop3/Cargo.toml +++ b/crates/pop3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pop3" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/services/Cargo.toml b/crates/services/Cargo.toml index 8f06b57e..575195f3 100644 --- a/crates/services/Cargo.toml +++ b/crates/services/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "services" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/smtp/Cargo.toml b/crates/smtp/Cargo.toml index 4ce37ba8..c1e5c6a3 100644 --- a/crates/smtp/Cargo.toml +++ b/crates/smtp/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://stalw.art/smtp" keywords = ["smtp", "email", "mail", "server"] categories = ["email"] license = "AGPL-3.0-only OR LicenseRef-SEL" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/spam-filter/Cargo.toml b/crates/spam-filter/Cargo.toml index 2777ab0f..320dcceb 100644 --- a/crates/spam-filter/Cargo.toml +++ b/crates/spam-filter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spam-filter" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/store/Cargo.toml b/crates/store/Cargo.toml index ce520e5e..583e141b 100644 --- a/crates/store/Cargo.toml +++ b/crates/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "store" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/trc/Cargo.toml b/crates/trc/Cargo.toml index 15ead4b1..cc4c6f1a 100644 --- a/crates/trc/Cargo.toml +++ b/crates/trc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trc" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/trc/event-macro/Cargo.toml b/crates/trc/event-macro/Cargo.toml index ae580746..6aa93903 100644 --- a/crates/trc/event-macro/Cargo.toml +++ b/crates/trc/event-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "event_macro" -version = "0.13.4" +version = "0.14.0" edition = "2024" [lib] diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 588aa768..7fa2348f 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "types" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" [dependencies] utils = { path = "../utils" } trc = { path = "../trc" } -jmap-tools = { path = "/Users/me/code/jmap-tool" } +jmap-tools = { version = "0.1" } hashify = "0.2" serde = { version = "1.0", features = ["derive"]} rkyv = { version = "0.8.10", features = ["little_endian"] } diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 2fe7bb3f..6ce64a74 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "utils" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/crates/utils/proc-macros/Cargo.toml b/crates/utils/proc-macros/Cargo.toml index de328c72..370241a3 100644 --- a/crates/utils/proc-macros/Cargo.toml +++ b/crates/utils/proc-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proc_macros" -version = "0.13.4" +version = "0.14.0" edition = "2024" [lib] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index bcf6786b..0f2cb33a 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tests" -version = "0.13.4" +version = "0.14.0" edition = "2024" resolver = "2" diff --git a/tests/src/cluster/mod.rs b/tests/src/cluster/mod.rs index b07e079c..9fb329bc 100644 --- a/tests/src/cluster/mod.rs +++ b/tests/src/cluster/mod.rs @@ -4,8 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::{path::PathBuf, sync::Arc, time::Duration}; - +use crate::{ + AssertConfig, TEST_USERS, add_test_certs, + directory::internal::TestInternalDirectory, + imap::{ImapConnection, Type}, + jmap::server::enterprise::EnterpriseCore, +}; use ahash::AHashMap; use common::{ Caches, Core, Data, Inner, Server, @@ -27,17 +31,11 @@ use managesieve::core::ManageSieveSessionManager; use pop3::Pop3SessionManager; use services::{SpawnServices, broadcast::subscriber::spawn_broadcast_subscriber}; use smtp::{SpawnQueueManager, core::SmtpSessionManager}; +use std::{path::PathBuf, sync::Arc, time::Duration}; use store::Stores; use tokio::sync::watch; use utils::config::Config; -use crate::{ - AssertConfig, TEST_USERS, add_test_certs, - directory::internal::TestInternalDirectory, - imap::{ImapConnection, Type}, - jmap::enterprise::EnterpriseCore, -}; - pub mod broadcast; pub mod stress; diff --git a/tests/src/cluster/stress.rs b/tests/src/cluster/stress.rs index 4a3c5fae..1647f153 100644 --- a/tests/src/cluster/stress.rs +++ b/tests/src/cluster/stress.rs @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes_no_wait, wait_for_index}; +use crate::jmap::{assert_is_empty, mail::mailbox::destroy_all_mailboxes_no_wait, wait_for_index}; use common::Server; use directory::backend::internal::manage::ManageDirectory; use email::{ diff --git a/tests/src/imap/acl.rs b/tests/src/imap/acl.rs index 74a9356d..838d9515 100644 --- a/tests/src/imap/acl.rs +++ b/tests/src/imap/acl.rs @@ -4,11 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use imap_proto::ResponseType; - -use crate::jmap::delivery::SmtpConnection; +use crate::jmap::mail::delivery::SmtpConnection; use super::{AssertResult, ImapConnection, Type, append::assert_append_message}; +use imap_proto::ResponseType; pub async fn test(mut imap_john: &mut ImapConnection, _imap_check: &mut ImapConnection) { // Delivery to support account diff --git a/tests/src/imap/bayes.rs b/tests/src/imap/bayes.rs index 6ef995fb..d16177c8 100644 --- a/tests/src/imap/bayes.rs +++ b/tests/src/imap/bayes.rs @@ -4,19 +4,17 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ +use super::{IMAPTest, ImapConnection}; +use crate::{ + imap::Type, + jmap::{mail::delivery::SmtpConnection, wait_for_index}, + smtp::session::VerifyResponse, +}; use common::KV_BAYES_MODEL_USER; use directory::backend::internal::manage::ManageDirectory; use imap_proto::ResponseType; use nlp::bayes::{TokenHash, Weights}; -use crate::{ - imap::Type, - jmap::{delivery::SmtpConnection, wait_for_index}, - smtp::session::VerifyResponse, -}; - -use super::{IMAPTest, ImapConnection}; - pub async fn test(handle: &IMAPTest) { println!("Running Bayes tests..."); let mut imap = ImapConnection::connect(b"_x ").await; diff --git a/tests/src/imap/idle.rs b/tests/src/imap/idle.rs index 14b4fa1c..dce021fd 100644 --- a/tests/src/imap/idle.rs +++ b/tests/src/imap/idle.rs @@ -4,13 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::time::Duration; - -use imap_proto::ResponseType; - -use crate::jmap::delivery::SmtpConnection; +use crate::jmap::mail::delivery::SmtpConnection; use super::{AssertResult, ImapConnection, Type}; +use imap_proto::ResponseType; +use std::time::Duration; const SLEEP: Duration = Duration::from_millis(200); diff --git a/tests/src/imap/pop.rs b/tests/src/imap/pop.rs index edc41702..e55ea2b7 100644 --- a/tests/src/imap/pop.rs +++ b/tests/src/imap/pop.rs @@ -4,6 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ +use crate::{jmap::mail::delivery::SmtpConnection, smtp::session::VerifyResponse}; use mail_send::smtp::tls::build_tls_connector; use rustls_pki_types::ServerName; use std::time::Duration; @@ -13,8 +14,6 @@ use tokio::{ }; use tokio_rustls::client::TlsStream; -use crate::{jmap::delivery::SmtpConnection, smtp::session::VerifyResponse}; - pub async fn test() { println!("Running POP3 tests..."); diff --git a/tests/src/jmap/auth_limits.rs b/tests/src/jmap/auth/limits.rs similarity index 98% rename from tests/src/jmap/auth_limits.rs rename to tests/src/jmap/auth/limits.rs index e69d6d88..143728c5 100644 --- a/tests/src/jmap/auth_limits.rs +++ b/tests/src/jmap/auth/limits.rs @@ -4,16 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::{ - net::{IpAddr, Ipv4Addr}, - sync::Arc, - time::Duration, -}; - use crate::{ directory::internal::TestInternalDirectory, imap::{ImapConnection, Type}, - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes}, }; use common::listener::blocked::BLOCKED_IP_KEY; use imap_proto::ResponseType; @@ -22,11 +16,14 @@ use jmap_client::{ core::set::{SetError, SetErrorType}, mailbox::{self}, }; +use std::{ + net::{IpAddr, Ipv4Addr}, + sync::Arc, + time::Duration, +}; use store::write::now; use types::id::Id; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running Authorization tests..."); @@ -162,7 +159,7 @@ pub async fn test(params: &mut JMAPTest) { assert_eq!(client.session().username(), "jdoe@example.com"); assert_eq!( client.session().account(&account_id).unwrap().name(), - "John Doe" + "jdoe@example.com" ); assert!(client.session().account(&account_id).unwrap().is_personal()); diff --git a/tests/src/jmap/auth/mod.rs b/tests/src/jmap/auth/mod.rs new file mode 100644 index 00000000..8add5490 --- /dev/null +++ b/tests/src/jmap/auth/mod.rs @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + +pub mod limits; +pub mod oauth; +pub mod permissions; +pub mod quota; diff --git a/tests/src/jmap/auth_oauth.rs b/tests/src/jmap/auth/oauth.rs similarity index 99% rename from tests/src/jmap/auth_oauth.rs rename to tests/src/jmap/auth/oauth.rs index 82d8dc46..e7ab4d21 100644 --- a/tests/src/jmap/auth_oauth.rs +++ b/tests/src/jmap/auth/oauth.rs @@ -4,7 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, imap::{ @@ -12,7 +11,8 @@ use crate::{ pop::{self, Pop3Connection}, }, jmap::{ - ManagementApi, assert_is_empty, delivery::SmtpConnection, mailbox::destroy_all_mailboxes, + JMAPTest, ManagementApi, assert_is_empty, + mail::{delivery::SmtpConnection, mailbox::destroy_all_mailboxes}, }, }; use base64::{Engine, engine::general_purpose}; diff --git a/tests/src/jmap/permissions.rs b/tests/src/jmap/auth/permissions.rs similarity index 99% rename from tests/src/jmap/permissions.rs rename to tests/src/jmap/auth/permissions.rs index 860beced..1bf10198 100644 --- a/tests/src/jmap/permissions.rs +++ b/tests/src/jmap/auth/permissions.rs @@ -4,8 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::{JMAPTest, ManagementApi, enterprise::List}; -use crate::jmap::assert_is_empty; +use crate::jmap::{JMAPTest, ManagementApi, assert_is_empty, server::List}; use ahash::AHashSet; use common::auth::{AccessToken, TenantInfo}; use directory::{ diff --git a/tests/src/jmap/quota.rs b/tests/src/jmap/auth/quota.rs similarity index 98% rename from tests/src/jmap/quota.rs rename to tests/src/jmap/auth/quota.rs index b6c7b77b..c2dc2069 100644 --- a/tests/src/jmap/quota.rs +++ b/tests/src/jmap/auth/quota.rs @@ -4,12 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, jmap::{ - assert_is_empty, delivery::SmtpConnection, emails_purge_tombstoned, jmap_raw_request, - mailbox::destroy_all_mailboxes, test_account_login, + JMAPTest, assert_is_empty, emails_purge_tombstoned, jmap_raw_request, + mail::{delivery::SmtpConnection, mailbox::destroy_all_mailboxes}, + test_account_login, }, smtp::queue::QueuedEvents, }; @@ -155,6 +155,7 @@ pub async fn test(params: &mut JMAPTest) { .take_id(), ); } + assert_over_quota( client .email_import( diff --git a/tests/src/jmap/calendar/mod.rs b/tests/src/jmap/calendar/mod.rs new file mode 100644 index 00000000..e63be942 --- /dev/null +++ b/tests/src/jmap/calendar/mod.rs @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + + \ No newline at end of file diff --git a/tests/src/jmap/contacts/mod.rs b/tests/src/jmap/contacts/mod.rs new file mode 100644 index 00000000..e63be942 --- /dev/null +++ b/tests/src/jmap/contacts/mod.rs @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + + \ No newline at end of file diff --git a/tests/src/jmap/blob.rs b/tests/src/jmap/core/blob.rs similarity index 99% rename from tests/src/jmap/blob.rs rename to tests/src/jmap/core/blob.rs index a98b3dbf..57813636 100644 --- a/tests/src/jmap/blob.rs +++ b/tests/src/jmap/core/blob.rs @@ -4,10 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, jmap_json_request, mailbox::destroy_all_mailboxes}, + jmap::{JMAPTest, assert_is_empty, jmap_json_request, mail::mailbox::destroy_all_mailboxes}, }; use email::mailbox::INBOX_ID; use serde_json::Value; diff --git a/tests/src/jmap/event_source.rs b/tests/src/jmap/core/event_source.rs similarity index 97% rename from tests/src/jmap/event_source.rs rename to tests/src/jmap/core/event_source.rs index 9b20ccb7..9e255c5c 100644 --- a/tests/src/jmap/event_source.rs +++ b/tests/src/jmap/core/event_source.rs @@ -9,7 +9,8 @@ use std::time::Duration; use crate::{ directory::internal::TestInternalDirectory, jmap::{ - assert_is_empty, delivery::SmtpConnection, mailbox::destroy_all_mailboxes, + JMAPTest, assert_is_empty, + mail::{delivery::SmtpConnection, mailbox::destroy_all_mailboxes}, test_account_login, }, }; @@ -17,13 +18,11 @@ use email::mailbox::INBOX_ID; use futures::StreamExt; use jmap_client::{TypeState, event_source::Changes, mailbox::Role}; -use types::id::Id; use store::ahash::AHashSet; +use types::id::Id; use tokio::sync::mpsc; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running EventSource tests..."); diff --git a/tests/src/jmap/core/mod.rs b/tests/src/jmap/core/mod.rs new file mode 100644 index 00000000..0e8c9a97 --- /dev/null +++ b/tests/src/jmap/core/mod.rs @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + +pub mod blob; +pub mod event_source; +pub mod push_subscription; +pub mod websocket; diff --git a/tests/src/jmap/push_subscription.rs b/tests/src/jmap/core/push_subscription.rs similarity index 99% rename from tests/src/jmap/push_subscription.rs rename to tests/src/jmap/core/push_subscription.rs index fa04f060..bf28348e 100644 --- a/tests/src/jmap/push_subscription.rs +++ b/tests/src/jmap/core/push_subscription.rs @@ -4,11 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ AssertConfig, add_test_certs, directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, test_account_login}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, test_account_login}, }; use base64::{Engine, engine::general_purpose}; use common::{Caches, Core, Data, Inner, config::server::Listeners, listener::SessionData}; diff --git a/tests/src/jmap/websocket.rs b/tests/src/jmap/core/websocket.rs similarity index 97% rename from tests/src/jmap/websocket.rs rename to tests/src/jmap/core/websocket.rs index 7a8f8574..78ef31be 100644 --- a/tests/src/jmap/websocket.rs +++ b/tests/src/jmap/core/websocket.rs @@ -21,11 +21,9 @@ use tokio::sync::mpsc; use crate::{ directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, test_account_login}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, test_account_login}, }; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running WebSockets tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/files/mod.rs b/tests/src/jmap/files/mod.rs new file mode 100644 index 00000000..69b01f91 --- /dev/null +++ b/tests/src/jmap/files/mod.rs @@ -0,0 +1,5 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ diff --git a/tests/src/jmap/auth_acl.rs b/tests/src/jmap/mail/acl.rs similarity index 99% rename from tests/src/jmap/auth_acl.rs rename to tests/src/jmap/mail/acl.rs index 2af2d6b6..53692130 100644 --- a/tests/src/jmap/auth_acl.rs +++ b/tests/src/jmap/mail/acl.rs @@ -6,7 +6,7 @@ use crate::{ directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, test_account_login}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, test_account_login}, }; use ::email::mailbox::{INBOX_ID, TRASH_ID}; use jmap_client::{ @@ -22,8 +22,6 @@ use std::fmt::Debug; use store::ahash::AHashMap; use types::id::Id; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running ACL tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/email_changes.rs b/tests/src/jmap/mail/changes.rs similarity index 99% rename from tests/src/jmap/email_changes.rs rename to tests/src/jmap/mail/changes.rs index 0e6a8933..0fe7c54f 100644 --- a/tests/src/jmap/email_changes.rs +++ b/tests/src/jmap/mail/changes.rs @@ -4,11 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::str::FromStr; - -use super::JMAPTest; -use crate::jmap::assert_is_empty; +use crate::jmap::{JMAPTest, assert_is_empty}; use jmap_proto::types::state::State; +use std::str::FromStr; use store::{ahash::AHashSet, write::BatchBuilder}; use types::{ collection::{Collection, SyncCollection}, diff --git a/tests/src/jmap/email_copy.rs b/tests/src/jmap/mail/copy.rs similarity index 97% rename from tests/src/jmap/email_copy.rs rename to tests/src/jmap/mail/copy.rs index 1cdaeb0a..8ad90caf 100644 --- a/tests/src/jmap/email_copy.rs +++ b/tests/src/jmap/mail/copy.rs @@ -4,8 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}; +use crate::jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes}; use jmap_client::mailbox::Role; use types::id::Id; diff --git a/tests/src/jmap/crypto.rs b/tests/src/jmap/mail/crypto.rs similarity index 99% rename from tests/src/jmap/crypto.rs rename to tests/src/jmap/mail/crypto.rs index 21bd3d01..4c0ffa2e 100644 --- a/tests/src/jmap/crypto.rs +++ b/tests/src/jmap/mail/crypto.rs @@ -4,10 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, - jmap::{ManagementApi, delivery::SmtpConnection}, + jmap::{JMAPTest, ManagementApi, mail::delivery::SmtpConnection}, }; use email::message::crypto::{ Algorithm, EncryptMessage, EncryptionMethod, EncryptionParams, EncryptionType, try_parse_certs, diff --git a/tests/src/jmap/delivery.rs b/tests/src/jmap/mail/delivery.rs similarity index 99% rename from tests/src/jmap/delivery.rs rename to tests/src/jmap/mail/delivery.rs index e6a5653a..7f58bf59 100644 --- a/tests/src/jmap/delivery.rs +++ b/tests/src/jmap/mail/delivery.rs @@ -4,10 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes}, webdav::DummyWebDavClient, }; use email::{ diff --git a/tests/src/jmap/email_get.rs b/tests/src/jmap/mail/get.rs similarity index 99% rename from tests/src/jmap/email_get.rs rename to tests/src/jmap/mail/get.rs index c8b3b6e6..c972021a 100644 --- a/tests/src/jmap/email_get.rs +++ b/tests/src/jmap/mail/get.rs @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, replace_blob_ids}; +use crate::jmap::{ + JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, replace_blob_ids, +}; use ::email::mailbox::INBOX_ID; use jmap_client::email::{self, Header, HeaderForm, import::EmailImportResponse}; use mail_parser::HeaderName; diff --git a/tests/src/jmap/mailbox.rs b/tests/src/jmap/mail/mailbox.rs similarity index 99% rename from tests/src/jmap/mailbox.rs rename to tests/src/jmap/mail/mailbox.rs index e4de0e8d..4065a7af 100644 --- a/tests/src/jmap/mailbox.rs +++ b/tests/src/jmap/mail/mailbox.rs @@ -4,8 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::time::Duration; - +use crate::jmap::{JMAPTest, assert_is_empty, wait_for_index}; use jmap_client::{ Error, Set, client::{Client, Credentials}, @@ -17,13 +16,10 @@ use jmap_client::{ }; use jmap_proto::types::state::State; use serde::{Deserialize, Serialize}; +use std::time::Duration; use store::ahash::AHashMap; use types::id::Id; -use crate::jmap::assert_is_empty; - -use super::{JMAPTest, wait_for_index}; - pub async fn test(params: &mut JMAPTest) { println!("Running Mailbox tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/mail/mod.rs b/tests/src/jmap/mail/mod.rs new file mode 100644 index 00000000..0a46503d --- /dev/null +++ b/tests/src/jmap/mail/mod.rs @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + +pub mod acl; +pub mod changes; +pub mod copy; +pub mod crypto; +pub mod delivery; +pub mod get; +pub mod mailbox; +pub mod parse; +pub mod query; +pub mod query_changes; +pub mod search_snippet; +pub mod set; +pub mod sieve_script; +pub mod submission; +pub mod thread_get; +pub mod thread_merge; +pub mod vacation_response; diff --git a/tests/src/jmap/email_parse.rs b/tests/src/jmap/mail/parse.rs similarity index 98% rename from tests/src/jmap/email_parse.rs rename to tests/src/jmap/mail/parse.rs index 32913235..9cc72a70 100644 --- a/tests/src/jmap/email_parse.rs +++ b/tests/src/jmap/mail/parse.rs @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::jmap::{ - assert_is_empty, email_get::all_headers, mailbox::destroy_all_mailboxes, replace_blob_ids, + JMAPTest, assert_is_empty, + mail::{get::all_headers, mailbox::destroy_all_mailboxes}, + replace_blob_ids, }; use jmap_client::{ email::{self, Header, HeaderForm}, diff --git a/tests/src/jmap/email_query.rs b/tests/src/jmap/mail/query.rs similarity index 99% rename from tests/src/jmap/email_query.rs rename to tests/src/jmap/mail/query.rs index b8f537bc..a074539b 100644 --- a/tests/src/jmap/email_query.rs +++ b/tests/src/jmap/mail/query.rs @@ -4,9 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, wait_for_index}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, wait_for_index}, store::{deflate_test_resource, query::FIELDS}, }; use ::email::{cache::MessageCacheFetch, mailbox::Mailbox}; diff --git a/tests/src/jmap/email_query_changes.rs b/tests/src/jmap/mail/query_changes.rs similarity index 98% rename from tests/src/jmap/email_query_changes.rs rename to tests/src/jmap/mail/query_changes.rs index 84ac770a..a8481ed6 100644 --- a/tests/src/jmap/email_query_changes.rs +++ b/tests/src/jmap/mail/query_changes.rs @@ -4,13 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::str::FromStr; - -use super::JMAPTest; use crate::jmap::{ - assert_is_empty, - email_changes::{LogAction, ParseState}, - mailbox::destroy_all_mailboxes, + JMAPTest, assert_is_empty, + mail::{ + changes::{LogAction, ParseState}, + mailbox::destroy_all_mailboxes, + }, }; use ::email::message::metadata::MessageData; use common::storage::index::ObjectIndexBuilder; @@ -20,6 +19,7 @@ use jmap_client::{ mailbox::Role, }; use jmap_proto::types::state::State; +use std::str::FromStr; use store::{ ahash::{AHashMap, AHashSet}, write::BatchBuilder, diff --git a/tests/src/jmap/email_search_snippet.rs b/tests/src/jmap/mail/search_snippet.rs similarity index 98% rename from tests/src/jmap/email_search_snippet.rs rename to tests/src/jmap/mail/search_snippet.rs index 3206065e..df269b68 100644 --- a/tests/src/jmap/email_search_snippet.rs +++ b/tests/src/jmap/mail/search_snippet.rs @@ -4,15 +4,15 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes, wait_for_index}; +use crate::jmap::{ + JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes, wait_for_index, +}; use email::mailbox::INBOX_ID; use jmap_client::{core::query, email::query::Filter}; use std::{fs, path::PathBuf}; use store::ahash::AHashMap; use types::id::Id; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running SearchSnippet tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/email_set.rs b/tests/src/jmap/mail/set.rs similarity index 98% rename from tests/src/jmap/email_set.rs rename to tests/src/jmap/mail/set.rs index 9208a461..811cf7e3 100644 --- a/tests/src/jmap/email_set.rs +++ b/tests/src/jmap/mail/set.rs @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use std::{fs, path::PathBuf}; - -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}; +use crate::jmap::{ + JMAPTest, assert_is_empty, find_values, mail::mailbox::destroy_all_mailboxes, replace_blob_ids, + replace_boundaries, replace_values, +}; use ::email::mailbox::INBOX_ID; use ahash::AHashSet; use jmap_client::{ @@ -16,10 +17,9 @@ use jmap_client::{ email::{self, Email}, mailbox::Role, }; +use std::{fs, path::PathBuf}; use types::id::Id; -use super::{JMAPTest, find_values, replace_blob_ids, replace_boundaries, replace_values}; - pub async fn test(params: &mut JMAPTest) { println!("Running Email Set tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/sieve_script.rs b/tests/src/jmap/mail/sieve_script.rs similarity index 98% rename from tests/src/jmap/sieve_script.rs rename to tests/src/jmap/mail/sieve_script.rs index dd39dd29..0f1f53fb 100644 --- a/tests/src/jmap/sieve_script.rs +++ b/tests/src/jmap/mail/sieve_script.rs @@ -4,31 +4,30 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ +use crate::{ + directory::internal::TestInternalDirectory, + jmap::{ + JMAPTest, assert_is_empty, + mail::{ + delivery::SmtpConnection, + mailbox::destroy_all_mailboxes, + submission::{MockMessage, assert_message_delivery, spawn_mock_smtp_server}, + }, + }, + smtp::DnsCache, +}; use jmap_client::{ Error, core::set::{SetError, SetErrorType}, email, mailbox, sieve::query::{Comparator, Filter}, }; -use types::id::Id; use std::{ fs, path::PathBuf, time::{Duration, Instant}, }; - -use crate::{ - directory::internal::TestInternalDirectory, - jmap::{ - assert_is_empty, - delivery::SmtpConnection, - email_submission::{MockMessage, assert_message_delivery, spawn_mock_smtp_server}, - mailbox::destroy_all_mailboxes, - }, - smtp::DnsCache, -}; - -use super::JMAPTest; +use types::id::Id; pub async fn test(params: &mut JMAPTest) { println!("Running Sieve tests..."); diff --git a/tests/src/jmap/email_submission.rs b/tests/src/jmap/mail/submission.rs similarity index 99% rename from tests/src/jmap/email_submission.rs rename to tests/src/jmap/mail/submission.rs index aaa25477..084e864c 100644 --- a/tests/src/jmap/email_submission.rs +++ b/tests/src/jmap/mail/submission.rs @@ -4,6 +4,14 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ +use crate::{ + directory::internal::TestInternalDirectory, + jmap::{ + JMAPTest, assert_is_empty, + mail::{mailbox::destroy_all_mailboxes, set::assert_email_properties}, + }, + smtp::DnsCache, +}; use ahash::AHashMap; use jmap_client::{ Error, @@ -11,27 +19,18 @@ use jmap_client::{ email_submission::{Address, Delivered, DeliveryStatus, Displayed, UndoStatus, query::Filter}, mailbox::Role, }; -use types::id::Id; use mail_parser::DateTime; use std::{ sync::Arc, time::{Duration, Instant}, }; use store::parking_lot::Mutex; - use tokio::{ io::{AsyncBufReadExt, AsyncWriteExt, BufReader}, net::TcpListener, sync::mpsc, }; - -use crate::{ - directory::internal::TestInternalDirectory, - jmap::{assert_is_empty, email_set::assert_email_properties, mailbox::destroy_all_mailboxes}, - smtp::DnsCache, -}; - -use super::JMAPTest; +use types::id::Id; #[derive(Default, Debug, PartialEq, Eq)] pub struct MockMessage { diff --git a/tests/src/jmap/thread_get.rs b/tests/src/jmap/mail/thread_get.rs similarity index 93% rename from tests/src/jmap/thread_get.rs rename to tests/src/jmap/mail/thread_get.rs index 5d5eb30d..99ff6294 100644 --- a/tests/src/jmap/thread_get.rs +++ b/tests/src/jmap/mail/thread_get.rs @@ -4,12 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use crate::jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}; +use crate::jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes}; use jmap_client::mailbox::Role; use types::id::Id; -use super::JMAPTest; - pub async fn test(params: &mut JMAPTest) { println!("Running Email Thread tests..."); let server = params.server.clone(); diff --git a/tests/src/jmap/thread_merge.rs b/tests/src/jmap/mail/thread_merge.rs similarity index 99% rename from tests/src/jmap/thread_merge.rs rename to tests/src/jmap/mail/thread_merge.rs index 2bbdcefa..811401d8 100644 --- a/tests/src/jmap/thread_merge.rs +++ b/tests/src/jmap/mail/thread_merge.rs @@ -4,9 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ - jmap::{assert_is_empty, mailbox::destroy_all_mailboxes}, + jmap::{JMAPTest, assert_is_empty, mail::mailbox::destroy_all_mailboxes}, store::deflate_test_resource, }; use ::email::message::ingest::{EmailIngest, IngestEmail, IngestSource}; diff --git a/tests/src/jmap/vacation_response.rs b/tests/src/jmap/mail/vacation_response.rs similarity index 94% rename from tests/src/jmap/vacation_response.rs rename to tests/src/jmap/mail/vacation_response.rs index 08dae085..92ca81e6 100644 --- a/tests/src/jmap/vacation_response.rs +++ b/tests/src/jmap/mail/vacation_response.rs @@ -4,25 +4,23 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use chrono::{TimeDelta, Utc}; - -use std::time::Instant; -use types::id::Id; - use crate::{ directory::internal::TestInternalDirectory, jmap::{ - assert_is_empty, - delivery::SmtpConnection, - email_submission::{ - MockMessage, assert_message_delivery, expect_nothing, spawn_mock_smtp_server, + JMAPTest, assert_is_empty, + mail::{ + delivery::SmtpConnection, + mailbox::destroy_all_mailboxes, + submission::{ + MockMessage, assert_message_delivery, expect_nothing, spawn_mock_smtp_server, + }, }, - mailbox::destroy_all_mailboxes, }, smtp::DnsCache, }; - -use super::JMAPTest; +use chrono::{TimeDelta, Utc}; +use std::time::Instant; +use types::id::Id; pub async fn test(params: &mut JMAPTest) { println!("Running Vacation Response tests..."); diff --git a/tests/src/jmap/mod.rs b/tests/src/jmap/mod.rs index 4b9c6901..1fa6f56c 100644 --- a/tests/src/jmap/mod.rs +++ b/tests/src/jmap/mod.rs @@ -5,7 +5,13 @@ */ use crate::{ - AssertConfig, add_test_certs, directory::internal::TestInternalDirectory, store::TempDir, + AssertConfig, add_test_certs, + directory::internal::TestInternalDirectory, + jmap::server::{ + enterprise::{EnterpriseCore, insert_test_metrics}, + webhooks::{MockWebhookEndpoint, spawn_mock_webhook_endpoint}, + }, + store::TempDir, }; use base64::{ Engine, @@ -25,7 +31,6 @@ use common::{ }, }; use email::message::delete::EmailDeletion; -use enterprise::{EnterpriseCore, insert_test_metrics}; use http::HttpSessionManager; use hyper::{Method, header::AUTHORIZATION}; use imap::core::ImapSessionManager; @@ -46,36 +51,14 @@ use store::{ use tokio::sync::watch; use types::{blob_hash::BlobHash, id::Id}; use utils::config::Config; -use webhooks::{MockWebhookEndpoint, spawn_mock_webhook_endpoint}; -pub mod auth_acl; -pub mod auth_limits; -pub mod auth_oauth; -pub mod blob; -pub mod crypto; -pub mod delivery; -pub mod email_changes; -pub mod email_copy; -pub mod email_get; -pub mod email_parse; -pub mod email_query; -pub mod email_query_changes; -pub mod email_search_snippet; -pub mod email_set; -pub mod email_submission; -pub mod enterprise; -pub mod event_source; -pub mod mailbox; -pub mod permissions; -pub mod purge; -pub mod push_subscription; -pub mod quota; -pub mod sieve_script; -pub mod thread_get; -pub mod thread_merge; -pub mod vacation_response; -pub mod webhooks; -pub mod websocket; +pub mod auth; +pub mod calendar; +pub mod contacts; +pub mod core; +pub mod files; +pub mod mail; +pub mod server; #[tokio::test(flavor = "multi_thread")] async fn jmap_tests() { @@ -87,34 +70,34 @@ async fn jmap_tests() { ) .await; - webhooks::test(&mut params).await; - /*email_query::test(&mut params, delete).await; - email_get::test(&mut params).await; - email_set::test(&mut params).await; - email_parse::test(&mut params).await; - email_search_snippet::test(&mut params).await; - email_changes::test(&mut params).await; - email_query_changes::test(&mut params).await; - email_copy::test(&mut params).await; - thread_get::test(&mut params).await; - thread_merge::test(&mut params).await; - mailbox::test(&mut params).await;*/ - delivery::test(&mut params).await; - auth_acl::test(&mut params).await; - auth_limits::test(&mut params).await; - auth_oauth::test(&mut params).await; - event_source::test(&mut params).await; - push_subscription::test(&mut params).await; - sieve_script::test(&mut params).await; - vacation_response::test(&mut params).await; - email_submission::test(&mut params).await; - websocket::test(&mut params).await; - quota::test(&mut params).await; - crypto::test(&mut params).await; - blob::test(&mut params).await; - permissions::test(¶ms).await; - purge::test(&mut params).await; - enterprise::test(&mut params).await; + server::webhooks::test(&mut params).await; + /*mail::query::test(&mut params, delete).await; + mail::get::test(&mut params).await; + mail::set::test(&mut params).await; + mail::parse::test(&mut params).await; + mail::search_snippet::test(&mut params).await; + mail::changes::test(&mut params).await; + mail::query_changes::test(&mut params).await; + mail::copy::test(&mut params).await; + mail::thread_get::test(&mut params).await; + mail::thread_merge::test(&mut params).await; + mail::mailbox::test(&mut params).await; + mail::delivery::test(&mut params).await; + mail::acl::test(&mut params).await;*/ + auth::limits::test(&mut params).await; + auth::oauth::test(&mut params).await; + core::event_source::test(&mut params).await; + core::push_subscription::test(&mut params).await; + mail::sieve_script::test(&mut params).await; + mail::vacation_response::test(&mut params).await; + mail::submission::test(&mut params).await; + core::websocket::test(&mut params).await; + auth::quota::test(&mut params).await; + mail::crypto::test(&mut params).await; + core::blob::test(&mut params).await; + auth::permissions::test(¶ms).await; + server::purge::test(&mut params).await; + server::enterprise::test(&mut params).await; if delete { params.temp_dir.delete(); diff --git a/tests/src/jmap/enterprise.rs b/tests/src/jmap/server/enterprise.rs similarity index 98% rename from tests/src/jmap/enterprise.rs rename to tests/src/jmap/server/enterprise.rs index 8d93dcee..3d71cef9 100644 --- a/tests/src/jmap/enterprise.rs +++ b/tests/src/jmap/server/enterprise.rs @@ -8,8 +8,16 @@ * */ -use std::{sync::Arc, time::Duration}; - +use crate::{ + AssertConfig, + directory::internal::TestInternalDirectory, + imap::{ImapConnection, Type}, + jmap::{ + JMAPTest, ManagementApi, + mail::delivery::{AssertResult, SmtpConnection}, + server::List, + }, +}; use common::{ Core, Server, config::telemetry::{StoreTracer, TelemetrySubscriberType}, @@ -25,6 +33,7 @@ use common::{ }; use http::management::enterprise::undelete::{UndeleteRequest, UndeleteResponse}; use imap_proto::ResponseType; +use std::{sync::Arc, time::Duration}; use store::{ rand::{self, Rng}, write::now, @@ -35,15 +44,6 @@ use trc::{ }; use utils::config::{Config, cron::SimpleCron}; -use crate::{ - AssertConfig, - directory::internal::TestInternalDirectory, - imap::{ImapConnection, Type}, - jmap::delivery::SmtpConnection, -}; - -use super::{JMAPTest, ManagementApi, delivery::AssertResult}; - const METRICS_CONFIG: &str = r#" [metrics.alerts.expected] enable = true @@ -509,10 +509,3 @@ pub async fn insert_test_metrics(core: Arc) { start_time += 60 * 60; } } - -#[derive(serde::Deserialize, Debug)] -#[allow(dead_code)] -pub(super) struct List { - pub items: Vec, - pub total: usize, -} diff --git a/tests/src/jmap/server/mod.rs b/tests/src/jmap/server/mod.rs new file mode 100644 index 00000000..a009f091 --- /dev/null +++ b/tests/src/jmap/server/mod.rs @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ + +pub mod enterprise; +pub mod purge; +pub mod webhooks; + +#[derive(serde::Deserialize, Debug)] +#[allow(dead_code)] +pub(crate) struct List { + pub items: Vec, + pub total: usize, +} diff --git a/tests/src/jmap/purge.rs b/tests/src/jmap/server/purge.rs similarity index 99% rename from tests/src/jmap/purge.rs rename to tests/src/jmap/server/purge.rs index d522a093..4275d785 100644 --- a/tests/src/jmap/purge.rs +++ b/tests/src/jmap/server/purge.rs @@ -4,11 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use super::JMAPTest; use crate::{ directory::internal::TestInternalDirectory, imap::{AssertResult, ImapConnection, Type}, - jmap::assert_is_empty, + jmap::{JMAPTest, assert_is_empty}, }; use ahash::AHashSet; use common::Server; diff --git a/tests/src/jmap/webhooks.rs b/tests/src/jmap/server/webhooks.rs similarity index 99% rename from tests/src/jmap/webhooks.rs rename to tests/src/jmap/server/webhooks.rs index 077e6493..c842fa41 100644 --- a/tests/src/jmap/webhooks.rs +++ b/tests/src/jmap/server/webhooks.rs @@ -12,6 +12,7 @@ use std::{ time::Duration, }; +use crate::jmap::JMAPTest; use base64::{Engine, engine::general_purpose::STANDARD}; use common::manager::webadmin::Resource; use http_proto::{ToHttpResponse, request::fetch_body}; @@ -23,8 +24,6 @@ use ring::hmac; use store::parking_lot::Mutex; use tokio::{net::TcpListener, sync::watch}; -use super::JMAPTest; - pub struct MockWebhookEndpoint { pub tx: watch::Sender, pub events: Mutex>, diff --git a/tests/src/smtp/inbound/antispam.rs b/tests/src/smtp/inbound/antispam.rs index 89611c63..fedbe1a0 100644 --- a/tests/src/smtp/inbound/antispam.rs +++ b/tests/src/smtp/inbound/antispam.rs @@ -1,10 +1,14 @@ -use std::{ - fs, - path::PathBuf, - sync::Arc, - time::{Duration, Instant}, -}; +/* + * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL + */ +use crate::{ + http_server::{HttpMessage, spawn_mock_http_server}, + jmap::server::enterprise::EnterpriseCore, + smtp::{DnsCache, TempDir, TestSMTP, session::TestSession}, +}; use ahash::{AHashMap, AHashSet}; use common::{ Core, @@ -18,7 +22,6 @@ use common::{ }, }, }; - use compact_str::{CompactString, ToCompactString}; use http_proto::{JsonResponse, ToHttpResponse}; use hyper::Method; @@ -44,15 +47,15 @@ use spam_filter::{ }, modules::html::{HtmlToken, html_to_tokens}, }; +use std::{ + fs, + path::PathBuf, + sync::Arc, + time::{Duration, Instant}, +}; use store::Stores; use utils::config::Config; -use crate::{ - http_server::{HttpMessage, spawn_mock_http_server}, - jmap::enterprise::EnterpriseCore, - smtp::{DnsCache, TempDir, TestSMTP, session::TestSession}, -}; - const CONFIG: &str = r#" [spam-filter.bayes.classify] balance = "0.0" diff --git a/tests/src/webdav/cal_alarm.rs b/tests/src/webdav/cal_alarm.rs index 4c1443f6..8f9ae1e7 100644 --- a/tests/src/webdav/cal_alarm.rs +++ b/tests/src/webdav/cal_alarm.rs @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use crate::jmap::mailbox::destroy_all_mailboxes_for_account; +use crate::jmap::mail::mailbox::destroy_all_mailboxes_for_account; use super::WebDavTest; use email::cache::MessageCacheFetch; diff --git a/tests/src/webdav/cal_query.rs b/tests/src/webdav/cal_query.rs index 8c704196..11754e7f 100644 --- a/tests/src/webdav/cal_query.rs +++ b/tests/src/webdav/cal_query.rs @@ -288,6 +288,19 @@ fn roundtrip_expansion(ics: &str, ignore_errors: bool) { }, ) .unwrap(); + + assert_eq!( + events_archive, + event_data + .expand_from_ids( + &mut events + .iter() + .map(|e| e.expansion_id) + .collect::>(), + Tz::UTC + ) + .unwrap() + ); events.sort_by(|a, b| { if a.comp_id == b.comp_id { a.start.cmp(&b.start) @@ -302,6 +315,9 @@ fn roundtrip_expansion(ics: &str, ignore_errors: bool) { a.comp_id.cmp(&b.comp_id) } }); + for event in events.iter_mut().chain(events_archive.iter_mut()) { + event.expansion_id = 0; + } assert_eq!(events, events_archive); } diff --git a/tests/src/webdav/cal_scheduling.rs b/tests/src/webdav/cal_scheduling.rs index b08e2762..5f360d6f 100644 --- a/tests/src/webdav/cal_scheduling.rs +++ b/tests/src/webdav/cal_scheduling.rs @@ -6,7 +6,7 @@ use super::WebDavTest; use crate::{ - jmap::mailbox::destroy_all_mailboxes_for_account, + jmap::mail::mailbox::destroy_all_mailboxes_for_account, webdav::{DummyWebDavClient, prop::ALL_DAV_PROPERTIES}, }; use calcard::{ diff --git a/tests/src/webdav/prop.rs b/tests/src/webdav/prop.rs index 8b34a58d..567a3f0c 100644 --- a/tests/src/webdav/prop.rs +++ b/tests/src/webdav/prop.rs @@ -533,8 +533,8 @@ pub async fn test(test: &WebDavTest, assisted_discovery: bool) { ), (DavProperty::WebDav(WebDavProperty::DisplayName), ""), ]; - if !is_file && resource_type == DavResourceName::Cal { - // DisplayName can be removed from calendar collections + if !is_file { + // DisplayName can't be removed from calendar/contact collections props.pop(); } client.patch_and_check(path, props).await;