Compare commits
21 Commits
3ae09c1e17
...
4ddbdcb46b
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ddbdcb46b | |||
| 54dc45660a | |||
| 3827f87111 | |||
| 25839328ac | |||
| b2c20cc010 | |||
| 7f1f61dc7d | |||
| 6ca2459034 | |||
| ea60cce86b | |||
| b4113cb59a | |||
| f0493d165d | |||
| 43d856ae7e | |||
| 5b48c5dbc3 | |||
| d16c221995 | |||
| 00ce9267c1 | |||
| 8acf541d53 | |||
| 49e93829dd | |||
| a8a5089ed3 | |||
| cc994df4e5 | |||
| d143b2715d | |||
| c2428c073c | |||
| 574de65c35 |
354
Cargo.lock
generated
354
Cargo.lock
generated
@ -33,7 +33,7 @@ version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cipher",
|
||||
"cpufeatures",
|
||||
]
|
||||
@ -528,7 +528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"libc",
|
||||
"miniz_oxide",
|
||||
"object",
|
||||
@ -695,9 +695,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bon"
|
||||
version = "3.7.0"
|
||||
version = "3.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67a0c21249ad725ebcadcb1b1885f8e3d56e8e6b8924f560268aab000982d637"
|
||||
checksum = "537c317ddf588aab15c695bf92cf55dec159b93221c074180ca3e0e5a94da415"
|
||||
dependencies = [
|
||||
"bon-macros",
|
||||
"rustversion",
|
||||
@ -705,9 +705,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bon-macros"
|
||||
version = "3.7.0"
|
||||
version = "3.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a660ebdea4d4d3ec7788cfc9c035b66efb66028b9b97bf6cde7023ccc8e77e28"
|
||||
checksum = "ca5abbf2d4a4c6896197c9de13d6d7cb7eff438c63dacde1dde980569cb00248"
|
||||
dependencies = [
|
||||
"darling 0.21.2",
|
||||
"ident_case",
|
||||
@ -934,9 +934,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.1"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
||||
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
@ -969,6 +969,28 @@ dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chrono-tz"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"chrono-tz-build",
|
||||
"phf 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chrono-tz-build"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f"
|
||||
dependencies = [
|
||||
"parse-zoneinfo",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.4.4"
|
||||
@ -1098,7 +1120,7 @@ version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
@ -1187,7 +1209,7 @@ version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1364,7 +1386,7 @@ dependencies = [
|
||||
"cssparser-macros",
|
||||
"dtoa-short",
|
||||
"itoa 1.0.15",
|
||||
"phf",
|
||||
"phf 0.11.3",
|
||||
"smallvec 1.15.1",
|
||||
]
|
||||
|
||||
@ -1377,7 +1399,7 @@ dependencies = [
|
||||
"cssparser-macros",
|
||||
"dtoa-short",
|
||||
"itoa 1.0.15",
|
||||
"phf",
|
||||
"phf 0.11.3",
|
||||
"smallvec 1.15.1",
|
||||
]
|
||||
|
||||
@ -1625,7 +1647,7 @@ version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"dirs-sys-next",
|
||||
]
|
||||
|
||||
@ -1725,7 +1747,7 @@ version = "0.8.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1760,7 +1782,7 @@ version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"home",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
@ -2053,7 +2075,7 @@ version = "0.2.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cba6ae63eb948698e300f645f87c70f76630d505f23b8907cf1e193ee85048c1"
|
||||
dependencies = [
|
||||
"unicode-width",
|
||||
"unicode-width 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2062,7 +2084,7 @@ version = "0.1.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"libc",
|
||||
"wasi 0.9.0+wasi-snapshot-preview1",
|
||||
]
|
||||
@ -2073,7 +2095,7 @@ version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"wasi 0.11.1+wasi-snapshot-preview1",
|
||||
@ -2086,7 +2108,7 @@ version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"r-efi",
|
||||
@ -2410,7 +2432,7 @@ dependencies = [
|
||||
"base64 0.21.7",
|
||||
"byteorder",
|
||||
"flate2",
|
||||
"nom",
|
||||
"nom 7.1.3",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
@ -2518,6 +2540,33 @@ dependencies = [
|
||||
"utf8-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "html2text"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74cda84f06c1cc83476f79ae8e2e892b626bdadafcb227baec54c918cadc18a0"
|
||||
dependencies = [
|
||||
"html5ever 0.26.0",
|
||||
"markup5ever 0.11.0",
|
||||
"tendril",
|
||||
"unicode-width 0.1.14",
|
||||
"xml5ever",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "html5ever"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
|
||||
dependencies = [
|
||||
"log",
|
||||
"mac",
|
||||
"markup5ever 0.11.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "html5ever"
|
||||
version = "0.29.1"
|
||||
@ -2858,6 +2907,28 @@ dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ical"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4bad4eb99ee34e58a1e642114eded65b4ea5ea3c1584971a1afc12a3b927670"
|
||||
dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icalendar"
|
||||
version = "0.17.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "557f23d5e90d205464cfc9e2f3d7c117b0c3e963830a2a623aa8d69a186041a3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"iso8601",
|
||||
"nom 8.0.0",
|
||||
"nom-language",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_collections"
|
||||
version = "2.0.0"
|
||||
@ -3049,7 +3120,7 @@ version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
@ -3062,7 +3133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
|
||||
dependencies = [
|
||||
"bitflags 2.9.2",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@ -3097,6 +3168,15 @@ version = "1.70.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
|
||||
|
||||
[[package]]
|
||||
name = "iso8601"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1082f0c48f143442a1ac6122f67e360ceee130b967af4d50996e5154a45df46"
|
||||
dependencies = [
|
||||
"nom 8.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.14.0"
|
||||
@ -3159,7 +3239,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-notmuch"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"log",
|
||||
@ -3174,9 +3254,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-notmuch"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
||||
checksum = "f8553357f63cca5f540f58ed8ae2a0e93745a2d3dd986697a8e04c013877dfbf"
|
||||
checksum = "01c3d8a5789032da625c854c019358c504dde49d08ff1261676d6e708de1cc88"
|
||||
dependencies = [
|
||||
"log",
|
||||
"mailparse",
|
||||
@ -3188,12 +3268,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-procmail2notmuch"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"letterbox-notmuch 0.17.34 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"letterbox-shared 0.17.34 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"letterbox-notmuch 0.17.36 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"letterbox-shared 0.17.36 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"serde",
|
||||
"sqlx",
|
||||
"tokio 1.47.1",
|
||||
@ -3201,7 +3281,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-server"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
dependencies = [
|
||||
"ammonia",
|
||||
"anyhow",
|
||||
@ -3215,14 +3295,18 @@ dependencies = [
|
||||
"build-info-build",
|
||||
"cacher",
|
||||
"chrono",
|
||||
"chrono-tz",
|
||||
"clap",
|
||||
"css-inline",
|
||||
"flate2",
|
||||
"futures 0.3.31",
|
||||
"headers",
|
||||
"html-escape",
|
||||
"letterbox-notmuch 0.17.34",
|
||||
"letterbox-shared 0.17.34",
|
||||
"html2text",
|
||||
"ical",
|
||||
"icalendar",
|
||||
"letterbox-notmuch 0.17.36",
|
||||
"letterbox-shared 0.17.36",
|
||||
"linkify",
|
||||
"lol_html",
|
||||
"mailparse",
|
||||
@ -3248,10 +3332,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-shared"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"letterbox-notmuch 0.17.34",
|
||||
"letterbox-notmuch 0.17.36",
|
||||
"regex",
|
||||
"serde",
|
||||
"sqlx",
|
||||
@ -3261,12 +3345,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-shared"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
||||
checksum = "fc4f19d9601d651e8cd8411f0600fc22975d8fac09f0256ad5ef13ab371e5d8e"
|
||||
checksum = "bef8e6e8a604f2c6c0d0d802ab4935051a830c5346cf8b573f246b7253ffc74a"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"letterbox-notmuch 0.17.34 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"letterbox-notmuch 0.17.36 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
||||
"regex",
|
||||
"serde",
|
||||
"sqlx",
|
||||
@ -3276,7 +3360,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-web"
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"build-info-build",
|
||||
@ -3288,7 +3372,7 @@ dependencies = [
|
||||
"graphql_client",
|
||||
"human_format",
|
||||
"itertools",
|
||||
"letterbox-shared 0.17.34",
|
||||
"letterbox-shared 0.17.36",
|
||||
"log",
|
||||
"seed",
|
||||
"seed_hooks",
|
||||
@ -3460,7 +3544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b63d49c99bfbf3400dd6450e516515b7014fcb49b5cb533f4b725a00c1462a36"
|
||||
dependencies = [
|
||||
"bitflags 2.9.2",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cssparser 0.35.0",
|
||||
"encoding_rs",
|
||||
"hashbrown 0.15.5",
|
||||
@ -3524,6 +3608,20 @@ version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
||||
|
||||
[[package]]
|
||||
name = "markup5ever"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
|
||||
dependencies = [
|
||||
"log",
|
||||
"phf 0.10.1",
|
||||
"phf_codegen 0.10.0",
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
"tendril",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "markup5ever"
|
||||
version = "0.14.1"
|
||||
@ -3531,8 +3629,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18"
|
||||
dependencies = [
|
||||
"log",
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
"tendril",
|
||||
@ -3615,7 +3713,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"digest 0.10.7",
|
||||
]
|
||||
|
||||
@ -3847,7 +3945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||
dependencies = [
|
||||
"bitflags 2.9.2",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
@ -3862,6 +3960,24 @@ dependencies = [
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "8.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom-language"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2de2bc5b451bfedaef92c90b8939a8fff5770bdcc1fafd6239d086aab8fa6b29"
|
||||
dependencies = [
|
||||
"nom 8.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nu-ansi-term"
|
||||
version = "0.46.0"
|
||||
@ -4000,7 +4116,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
|
||||
dependencies = [
|
||||
"bitflags 2.9.2",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"foreign-types",
|
||||
"libc",
|
||||
"once_cell",
|
||||
@ -4209,7 +4325,7 @@ version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"instant",
|
||||
"libc",
|
||||
"redox_syscall 0.2.16",
|
||||
@ -4223,13 +4339,22 @@ version = "0.9.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"libc",
|
||||
"redox_syscall 0.5.17",
|
||||
"smallvec 1.15.1",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parse-zoneinfo"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24"
|
||||
dependencies = [
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
@ -4305,6 +4430,15 @@ dependencies = [
|
||||
"sha2 0.10.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
|
||||
dependencies = [
|
||||
"phf_shared 0.10.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.11.3"
|
||||
@ -4312,7 +4446,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
|
||||
dependencies = [
|
||||
"phf_macros",
|
||||
"phf_shared",
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_codegen"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
|
||||
dependencies = [
|
||||
"phf_generator 0.10.0",
|
||||
"phf_shared 0.10.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4321,8 +4465,18 @@ version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
"phf_generator 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
|
||||
dependencies = [
|
||||
"phf_shared 0.10.0",
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4331,7 +4485,7 @@ version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
|
||||
dependencies = [
|
||||
"phf_shared",
|
||||
"phf_shared 0.11.3",
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
@ -4341,20 +4495,29 @@ version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
"phf_generator 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.106",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
|
||||
dependencies = [
|
||||
"siphasher 0.3.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
|
||||
dependencies = [
|
||||
"siphasher",
|
||||
"siphasher 1.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4464,9 +4627,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.2.36"
|
||||
version = "0.2.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2"
|
||||
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn 2.0.106",
|
||||
@ -4570,9 +4733,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.38.1"
|
||||
version = "0.38.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9845d9dccf565065824e69f9f235fafba1587031eda353c1f1561cd6a6be78f4"
|
||||
checksum = "d200a41a7797e6461bd04e4e95c3347053a731c32c87f066f2f0dda22dbdbba8"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"serde",
|
||||
@ -4915,7 +5078,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"getrandom 0.2.16",
|
||||
"libc",
|
||||
"untrusted",
|
||||
@ -5386,8 +5549,8 @@ dependencies = [
|
||||
"fxhash",
|
||||
"log",
|
||||
"new_debug_unreachable",
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
"precomputed-hash",
|
||||
"servo_arc",
|
||||
"smallvec 1.15.1",
|
||||
@ -5405,8 +5568,8 @@ dependencies = [
|
||||
"fxhash",
|
||||
"log",
|
||||
"new_debug_unreachable",
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
"precomputed-hash",
|
||||
"servo_arc",
|
||||
"smallvec 1.15.1",
|
||||
@ -5490,9 +5653,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.142"
|
||||
version = "1.0.143"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
|
||||
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
|
||||
dependencies = [
|
||||
"itoa 1.0.15",
|
||||
"memchr",
|
||||
@ -5546,7 +5709,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
]
|
||||
@ -5576,7 +5739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
|
||||
dependencies = [
|
||||
"block-buffer 0.9.0",
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cpufeatures",
|
||||
"digest 0.9.0",
|
||||
"opaque-debug 0.3.1",
|
||||
@ -5588,7 +5751,7 @@ version = "0.10.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"cpufeatures",
|
||||
"digest 0.10.7",
|
||||
]
|
||||
@ -5639,6 +5802,12 @@ version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.1"
|
||||
@ -5947,7 +6116,7 @@ checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"
|
||||
dependencies = [
|
||||
"new_debug_unreachable",
|
||||
"parking_lot 0.12.4",
|
||||
"phf_shared",
|
||||
"phf_shared 0.11.3",
|
||||
"precomputed-hash",
|
||||
"serde",
|
||||
]
|
||||
@ -5958,8 +6127,8 @@ version = "0.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
"phf_generator 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
]
|
||||
@ -6203,7 +6372,7 @@ version = "0.24.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e810cdeeebca57fc3f7bfec5f85fdbea9031b2ac9b990eb5ff49b371d52bbe6a"
|
||||
dependencies = [
|
||||
"nom",
|
||||
"nom 7.1.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
@ -6244,15 +6413,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.20.0"
|
||||
version = "3.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
|
||||
checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.3.3",
|
||||
"once_cell",
|
||||
"rustix 1.0.8",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -6312,7 +6481,7 @@ version = "1.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -6369,9 +6538,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.9.0"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
|
||||
checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
|
||||
dependencies = [
|
||||
"tinyvec_macros",
|
||||
]
|
||||
@ -7029,6 +7198,12 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.2.1"
|
||||
@ -7205,7 +7380,7 @@ version = "0.2.100"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"once_cell",
|
||||
"rustversion",
|
||||
"wasm-bindgen-macro",
|
||||
@ -7231,7 +7406,7 @@ version = "0.4.50"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.1",
|
||||
"cfg-if 1.0.3",
|
||||
"js-sys",
|
||||
"once_cell",
|
||||
"wasm-bindgen",
|
||||
@ -7333,8 +7508,8 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414"
|
||||
dependencies = [
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
]
|
||||
@ -7389,11 +7564,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
version = "0.1.9"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -7734,6 +7909,17 @@ version = "0.8.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7"
|
||||
|
||||
[[package]]
|
||||
name = "xml5ever"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4034e1d05af98b51ad7214527730626f019682d797ba38b51689212118d8e650"
|
||||
dependencies = [
|
||||
"log",
|
||||
"mac",
|
||||
"markup5ever 0.11.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xtracing"
|
||||
version = "0.3.2"
|
||||
|
||||
@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
||||
edition = "2021"
|
||||
license = "UNLICENSED"
|
||||
publish = ["xinu"]
|
||||
version = "0.17.34"
|
||||
version = "0.17.36"
|
||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@ -12,6 +12,8 @@ version.workspace = true
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
chrono-tz = "0.8"
|
||||
html2text = "0.6"
|
||||
ammonia = "4.1.0"
|
||||
anyhow = "1.0.98"
|
||||
askama = { version = "0.14.0", features = ["derive"] }
|
||||
@ -29,8 +31,10 @@ flate2 = "1.1.2"
|
||||
futures = "0.3.31"
|
||||
headers = "0.4.0"
|
||||
html-escape = "0.2.13"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.34", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.34", registry = "xinu" }
|
||||
icalendar = "0.17.1"
|
||||
ical = "0.10"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.36", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.36", registry = "xinu" }
|
||||
linkify = "0.10.0"
|
||||
lol_html = "2.3.0"
|
||||
mailparse = "0.16.1"
|
||||
|
||||
@ -119,9 +119,10 @@ async fn download_attachment(
|
||||
} else {
|
||||
format!("id:{}", id)
|
||||
};
|
||||
info!("download attachment {mid} {idx}");
|
||||
info!("download attachment message id '{mid}' idx '{idx}'");
|
||||
let idx: Vec<_> = idx
|
||||
.split('.')
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| s.parse().expect("not a usize"))
|
||||
.collect();
|
||||
let attachment = attachment_bytes(&nm, &mid, &idx)?;
|
||||
|
||||
@ -1,7 +1,358 @@
|
||||
// --- TESTS ---
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn google_calendar_email_renders_ical_summary() {
|
||||
use mailparse::parse_mail;
|
||||
let raw_email = include_str!("../testdata/google-calendar-example.eml");
|
||||
let parsed = parse_mail(raw_email.as_bytes()).expect("parse_mail");
|
||||
let mut part_addr = vec![];
|
||||
let body = extract_body(&parsed, &mut part_addr).expect("extract_body");
|
||||
let meta = extract_calendar_metadata_from_mail(&parsed, &body);
|
||||
// Assert detection as Google Calendar
|
||||
assert!(meta.is_google_calendar_event);
|
||||
// Assert metadata extraction
|
||||
assert_eq!(meta.summary, Some("Tamara and Scout in Alaska".to_string()));
|
||||
assert_eq!(meta.organizer, Some("tconvertino@gmail.com".to_string()));
|
||||
assert_eq!(meta.start_date, Some("20250624".to_string()));
|
||||
assert_eq!(meta.end_date, Some("20250701".to_string()));
|
||||
// Debug: print the rendered HTML for inspection
|
||||
if let Some(ref html) = meta.body_html {
|
||||
println!("Rendered HTML: {}", html);
|
||||
} else {
|
||||
println!("No body_html rendered");
|
||||
}
|
||||
// Assert ical summary is rendered and prepended (look for 'ical-flex' class)
|
||||
assert!(meta
|
||||
.body_html
|
||||
.as_ref()
|
||||
.map(|h| h.contains("ical-flex"))
|
||||
.unwrap_or(false));
|
||||
}
|
||||
}
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct ExtractedCalendarMetadata {
|
||||
pub is_google_calendar_event: bool,
|
||||
pub summary: Option<String>,
|
||||
pub organizer: Option<String>,
|
||||
pub start_date: Option<String>,
|
||||
pub end_date: Option<String>,
|
||||
pub body_html: Option<String>,
|
||||
}
|
||||
|
||||
/// Helper to extract Google Calendar event metadata from a ParsedMail (for tests and features)
|
||||
pub fn extract_calendar_metadata_from_mail(
|
||||
m: &ParsedMail,
|
||||
body: &Body,
|
||||
) -> ExtractedCalendarMetadata {
|
||||
// Detect Google Calendar by sender or headers
|
||||
let mut is_google = false;
|
||||
let mut summary = None;
|
||||
let mut organizer = None;
|
||||
let mut start_date = None;
|
||||
let mut end_date = None;
|
||||
let mut body_html = None;
|
||||
|
||||
// Check sender
|
||||
if let Some(from) = m.headers.get_first_value("Sender") {
|
||||
if from.contains("calendar-notification@google.com") {
|
||||
is_google = true;
|
||||
}
|
||||
}
|
||||
// Check for Google Calendar subject
|
||||
if let Some(subject) = m.headers.get_first_value("Subject") {
|
||||
if subject.contains("New event:") || subject.contains("Google Calendar") {
|
||||
is_google = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Try to extract from text/calendar part if present
|
||||
fn find_ical<'a>(m: &'a ParsedMail) -> Option<String> {
|
||||
if m.ctype.mimetype == TEXT_CALENDAR {
|
||||
m.get_body().ok()
|
||||
} else {
|
||||
for sp in &m.subparts {
|
||||
if let Some(b) = find_ical(sp) {
|
||||
return Some(b);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
let ical_opt = find_ical(m);
|
||||
if let Some(ical) = ical_opt {
|
||||
// Use existing render_ical_summary to extract fields
|
||||
if let Ok(rendered) = render_ical_summary(&ical) {
|
||||
// Try to extract summary, organizer, start/end from the ical
|
||||
// (This is a hack: parse the ical again for fields)
|
||||
use ical::IcalParser;
|
||||
let mut parser = IcalParser::new(ical.as_bytes());
|
||||
if let Some(Ok(calendar)) = parser.next() {
|
||||
for event in calendar.events {
|
||||
for prop in &event.properties {
|
||||
match prop.name.as_str() {
|
||||
"SUMMARY" => summary = prop.value.clone(),
|
||||
"ORGANIZER" => organizer = prop.value.clone(),
|
||||
"DTSTART" => {
|
||||
if let Some(dt) = &prop.value {
|
||||
if dt.len() >= 8 {
|
||||
start_date = Some(dt[0..8].to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
"DTEND" => {
|
||||
if let Some(dt) = &prop.value {
|
||||
if dt.len() >= 8 {
|
||||
end_date = Some(dt[0..8].to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
body_html = Some(rendered);
|
||||
}
|
||||
} else {
|
||||
// Fallback: try to extract summary and organizer from headers if this is a Google Calendar event
|
||||
if is_google {
|
||||
if let Some(subject) = m.headers.get_first_value("Subject") {
|
||||
// Try to extract event summary from subject, e.g. "New event: Tamara and Scout in Alaska @ ..."
|
||||
let summary_guess = subject
|
||||
.splitn(2, ':')
|
||||
.nth(1)
|
||||
.and_then(|s| s.split('@').next())
|
||||
.map(|s| s.trim().to_string());
|
||||
if let Some(s) = summary_guess {
|
||||
summary = Some(s);
|
||||
}
|
||||
// Try to extract start/end dates from subject, e.g. "@ Tue Jun 24 - Mon Jun 30, 2025"
|
||||
if let Some(at_idx) = subject.find('@') {
|
||||
let after_at = &subject[at_idx + 1..];
|
||||
// Look for a date range like "Tue Jun 24 - Mon Jun 30, 2025"
|
||||
let date_re = regex::Regex::new(
|
||||
r"(\w{3}) (\w{3}) (\d{1,2}) - (\w{3}) (\w{3}) (\d{1,2}), (\d{4})",
|
||||
)
|
||||
.ok();
|
||||
if let Some(re) = &date_re {
|
||||
if let Some(caps) = re.captures(after_at) {
|
||||
// e.g. Tue Jun 24 - Mon Jun 30, 2025
|
||||
let start_month = &caps[2];
|
||||
let start_day = &caps[3];
|
||||
let end_month = &caps[5];
|
||||
let end_day = &caps[6];
|
||||
let year = &caps[7];
|
||||
// Try to parse months as numbers
|
||||
let month_map = [
|
||||
("Jan", "01"),
|
||||
("Feb", "02"),
|
||||
("Mar", "03"),
|
||||
("Apr", "04"),
|
||||
("May", "05"),
|
||||
("Jun", "06"),
|
||||
("Jul", "07"),
|
||||
("Aug", "08"),
|
||||
("Sep", "09"),
|
||||
("Oct", "10"),
|
||||
("Nov", "11"),
|
||||
("Dec", "12"),
|
||||
];
|
||||
let start_month_num = month_map
|
||||
.iter()
|
||||
.find(|(m, _)| *m == start_month)
|
||||
.map(|(_, n)| *n)
|
||||
.unwrap_or("01");
|
||||
let end_month_num = month_map
|
||||
.iter()
|
||||
.find(|(m, _)| *m == end_month)
|
||||
.map(|(_, n)| *n)
|
||||
.unwrap_or("01");
|
||||
let start_date_str = format!(
|
||||
"{}{}{}",
|
||||
year,
|
||||
start_month_num,
|
||||
format!("{:0>2}", start_day)
|
||||
);
|
||||
let end_date_str =
|
||||
format!("{}{}{}", year, end_month_num, format!("{:0>2}", end_day));
|
||||
// Increment end date by one day to match iCalendar exclusive end date
|
||||
let end_date_exclusive =
|
||||
chrono::NaiveDate::parse_from_str(&end_date_str, "%Y%m%d")
|
||||
.ok()
|
||||
.and_then(|d| d.succ_opt())
|
||||
.map(|d| d.format("%Y%m%d").to_string())
|
||||
.unwrap_or(end_date_str);
|
||||
start_date = Some(start_date_str);
|
||||
end_date = Some(end_date_exclusive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Try to extract organizer from From header
|
||||
if organizer.is_none() {
|
||||
if let Some(from) = m.headers.get_first_value("From") {
|
||||
// Try to extract email address from From header
|
||||
let email = from
|
||||
.split('<')
|
||||
.nth(1)
|
||||
.and_then(|s| s.split('>').next())
|
||||
.map(|s| s.trim().to_string())
|
||||
.or_else(|| Some(from.trim().to_string()));
|
||||
organizer = email;
|
||||
}
|
||||
}
|
||||
|
||||
// Render the ical-summary template using the extracted metadata if we have enough info
|
||||
if summary.is_some() && start_date.is_some() && end_date.is_some() {
|
||||
use chrono::NaiveDate;
|
||||
let summary_val = summary.as_deref().unwrap_or("");
|
||||
let organizer_val = organizer.as_deref().unwrap_or("");
|
||||
let allday = start_date.as_ref().map(|s| s.len() == 8).unwrap_or(false)
|
||||
&& end_date.as_ref().map(|s| s.len() == 8).unwrap_or(false);
|
||||
let local_fmt_start = start_date
|
||||
.as_ref()
|
||||
.and_then(|d| NaiveDate::parse_from_str(d, "%Y%m%d").ok())
|
||||
.map(|d| {
|
||||
if allday {
|
||||
d.format("%a %b %e, %Y").to_string()
|
||||
} else {
|
||||
d.format("%-I:%M %p %a %b %e, %Y").to_string()
|
||||
}
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let local_fmt_end = end_date
|
||||
.as_ref()
|
||||
.and_then(|d| NaiveDate::parse_from_str(d, "%Y%m%d").ok())
|
||||
.map(|d| {
|
||||
if allday {
|
||||
d.format("%a %b %e, %Y").to_string()
|
||||
} else {
|
||||
d.format("%-I:%M %p %a %b %e, %Y").to_string()
|
||||
}
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let mut event_days = vec![];
|
||||
if let (Some(start), Some(end)) = (start_date.as_ref(), end_date.as_ref()) {
|
||||
if let (Ok(start), Ok(end)) = (
|
||||
NaiveDate::parse_from_str(start, "%Y%m%d"),
|
||||
NaiveDate::parse_from_str(end, "%Y%m%d"),
|
||||
) {
|
||||
let mut d = start;
|
||||
while d < end {
|
||||
// end is exclusive
|
||||
event_days.push(d);
|
||||
d = d.succ_opt().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Compute calendar grid for template rendering
|
||||
let (all_days, caption) = if !event_days.is_empty() {
|
||||
let first_event = event_days.first().unwrap();
|
||||
let last_event = event_days.last().unwrap();
|
||||
let first_of_month =
|
||||
NaiveDate::from_ymd_opt(first_event.year(), first_event.month(), 1)
|
||||
.unwrap();
|
||||
let last_of_month = {
|
||||
let next_month = if last_event.month() == 12 {
|
||||
NaiveDate::from_ymd_opt(last_event.year() + 1, 1, 1).unwrap()
|
||||
} else {
|
||||
NaiveDate::from_ymd_opt(last_event.year(), last_event.month() + 1, 1)
|
||||
.unwrap()
|
||||
};
|
||||
next_month.pred_opt().unwrap()
|
||||
};
|
||||
let mut cal_start = first_of_month;
|
||||
while cal_start.weekday() != chrono::Weekday::Sun {
|
||||
cal_start = cal_start.pred_opt().unwrap();
|
||||
}
|
||||
let mut cal_end = last_of_month;
|
||||
while cal_end.weekday() != chrono::Weekday::Sat {
|
||||
cal_end = cal_end.succ_opt().unwrap();
|
||||
}
|
||||
let mut all_days = vec![];
|
||||
let mut d = cal_start;
|
||||
while d <= cal_end {
|
||||
all_days.push(d);
|
||||
d = d.succ_opt().unwrap();
|
||||
}
|
||||
let start_month = first_event.format("%B %Y");
|
||||
let end_month = last_event.format("%B %Y");
|
||||
let caption = if start_month.to_string() == end_month.to_string() {
|
||||
start_month.to_string()
|
||||
} else {
|
||||
format!("{} – {}", start_month, end_month)
|
||||
};
|
||||
(all_days, caption)
|
||||
} else {
|
||||
(vec![], String::new())
|
||||
};
|
||||
let description_paragraphs: Vec<String> = Vec::new();
|
||||
let template = IcalSummaryTemplate {
|
||||
summary: summary_val,
|
||||
local_fmt_start: &local_fmt_start,
|
||||
local_fmt_end: &local_fmt_end,
|
||||
organizer: organizer_val,
|
||||
organizer_cn: "",
|
||||
all_days,
|
||||
event_days: event_days.clone(),
|
||||
caption,
|
||||
description_paragraphs: &description_paragraphs,
|
||||
today: Some(chrono::Local::now().date_naive()),
|
||||
};
|
||||
if let Ok(rendered) = template.render() {
|
||||
body_html = Some(rendered);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback: try to extract from HTML body if present
|
||||
if body_html.is_none() {
|
||||
if let Body::Html(h) = body {
|
||||
body_html = Some(h.html.clone());
|
||||
}
|
||||
}
|
||||
ExtractedCalendarMetadata {
|
||||
is_google_calendar_event: is_google,
|
||||
summary,
|
||||
organizer,
|
||||
start_date,
|
||||
end_date,
|
||||
body_html,
|
||||
}
|
||||
}
|
||||
// Inline Askama filters module for template use
|
||||
mod filters {
|
||||
// Usage: {{ items|batch(7) }}
|
||||
pub fn batch<T: Clone>(
|
||||
items: &[T],
|
||||
_: &dyn ::askama::Values,
|
||||
size: usize,
|
||||
) -> askama::Result<Vec<Vec<T>>> {
|
||||
if size == 0 {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
let mut chunk = Vec::with_capacity(size);
|
||||
for item in items {
|
||||
chunk.push(item.clone());
|
||||
if chunk.len() == size {
|
||||
out.push(chunk);
|
||||
chunk = Vec::with_capacity(size);
|
||||
}
|
||||
}
|
||||
if !chunk.is_empty() {
|
||||
out.push(chunk);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
}
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use askama::Template;
|
||||
use chrono::{TimeZone, Utc};
|
||||
use chrono::{Datelike, Local, LocalResult, NaiveDate, TimeZone, Utc};
|
||||
use chrono_tz::Tz;
|
||||
use mailparse::{parse_content_type, parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||
use quick_xml::de::from_str as xml_from_str;
|
||||
use tracing::{error, info, warn};
|
||||
@ -24,6 +375,7 @@ const MULTIPART_ALTERNATIVE: &'static str = "multipart/alternative";
|
||||
const MULTIPART_MIXED: &'static str = "multipart/mixed";
|
||||
const MULTIPART_RELATED: &'static str = "multipart/related";
|
||||
const MULTIPART_REPORT: &'static str = "multipart/report";
|
||||
const TEXT_CALENDAR: &'static str = "text/calendar";
|
||||
const TEXT_HTML: &'static str = "text/html";
|
||||
const TEXT_PLAIN: &'static str = "text/plain";
|
||||
|
||||
@ -87,6 +439,7 @@ pub fn extract_body(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body,
|
||||
// APPLICATION_ZIP and APPLICATION_GZIP are handled in the thread function
|
||||
APPLICATION_ZIP => extract_unhandled(m),
|
||||
APPLICATION_GZIP => extract_unhandled(m),
|
||||
mt if mt.starts_with("application/") => Ok(Body::text("".to_string())),
|
||||
_ => extract_unhandled(m),
|
||||
};
|
||||
if let Err(err) = ret {
|
||||
@ -307,6 +660,7 @@ pub fn extract_alternative(
|
||||
MULTIPART_ALTERNATIVE,
|
||||
MULTIPART_MIXED,
|
||||
MULTIPART_RELATED,
|
||||
TEXT_CALENDAR,
|
||||
TEXT_HTML,
|
||||
TEXT_PLAIN,
|
||||
];
|
||||
@ -325,18 +679,53 @@ pub fn extract_alternative(
|
||||
return extract_related(sp, part_addr);
|
||||
}
|
||||
}
|
||||
let mut ical_summary: Option<String> = None;
|
||||
// Try to find a text/calendar part as before
|
||||
for sp in &m.subparts {
|
||||
if sp.ctype.mimetype.as_str() == TEXT_CALENDAR {
|
||||
let body = sp.get_body()?;
|
||||
let summary = render_ical_summary(&body)?;
|
||||
ical_summary = Some(summary);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If not found, try to detect Google Calendar event and render summary from metadata
|
||||
if ical_summary.is_none() {
|
||||
let meta = extract_calendar_metadata_from_mail(m, &Body::text(String::new()));
|
||||
if meta.is_google_calendar_event {
|
||||
if let Some(rendered) = meta.body_html {
|
||||
ical_summary = Some(rendered);
|
||||
}
|
||||
}
|
||||
}
|
||||
for sp in &m.subparts {
|
||||
if sp.ctype.mimetype.as_str() == TEXT_HTML {
|
||||
let body = sp.get_body()?;
|
||||
return Ok(Body::html(body));
|
||||
if let Some(ref summary) = ical_summary {
|
||||
// Prepend summary to HTML body
|
||||
let combined = format!("{}<hr>{}", summary, body);
|
||||
return Ok(Body::html(combined));
|
||||
} else {
|
||||
return Ok(Body::html(body));
|
||||
}
|
||||
}
|
||||
}
|
||||
for sp in &m.subparts {
|
||||
if sp.ctype.mimetype.as_str() == TEXT_PLAIN {
|
||||
let body = sp.get_body()?;
|
||||
return Ok(Body::text(body));
|
||||
if let Some(ref summary) = ical_summary {
|
||||
// Prepend summary to plain text body (strip HTML tags)
|
||||
let summary_text = html2text::from_read(summary.as_bytes(), 80);
|
||||
let combined = format!("{}\n\n{}", summary_text.trim(), body);
|
||||
return Ok(Body::text(combined));
|
||||
} else {
|
||||
return Ok(Body::text(body));
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(summary) = ical_summary {
|
||||
return Ok(Body::html(summary));
|
||||
}
|
||||
Err(ServerError::StringError(format!(
|
||||
"extract_alternative failed to find suitable subpart, searched: {:?}",
|
||||
handled_types
|
||||
@ -362,7 +751,7 @@ pub fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body
|
||||
.subparts
|
||||
.iter()
|
||||
.map(|sp| sp.ctype.mimetype.as_str())
|
||||
.filter(|mt| !handled_types.contains(mt))
|
||||
.filter(|mt| !handled_types.contains(mt) && !mt.starts_with("application/"))
|
||||
.collect();
|
||||
unhandled_types.sort();
|
||||
if !unhandled_types.is_empty() {
|
||||
@ -413,9 +802,9 @@ pub fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body
|
||||
// For DMARC, it's always XML.
|
||||
// Pretty print JSON (if it were TLS)
|
||||
if let Ok(parsed_json) = serde_json::from_str::<serde_json::Value>(&xml) {
|
||||
serde_json::to_string_pretty(&parsed_json).unwrap_or(xml)
|
||||
serde_json::to_string_pretty(&parsed_json).unwrap_or(xml.to_string())
|
||||
} else {
|
||||
xml
|
||||
xml.to_string()
|
||||
}
|
||||
} else {
|
||||
// DMARC reports are XML
|
||||
@ -424,7 +813,7 @@ pub fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body
|
||||
Ok(pretty_xml) => pretty_xml,
|
||||
Err(e) => {
|
||||
error!("Failed to pretty print XML: {:?}", e);
|
||||
xml
|
||||
xml.to_string()
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -434,7 +823,11 @@ pub fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body
|
||||
)));
|
||||
}
|
||||
}
|
||||
mt => parts.push(unhandled_html(MULTIPART_MIXED, mt)),
|
||||
mt => {
|
||||
if !mt.starts_with("application/") {
|
||||
parts.push(unhandled_html(MULTIPART_MIXED, mt))
|
||||
}
|
||||
}
|
||||
}
|
||||
part_addr.pop();
|
||||
}
|
||||
@ -500,7 +893,7 @@ pub fn extract_related(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Bo
|
||||
.subparts
|
||||
.iter()
|
||||
.map(|sp| sp.ctype.mimetype.as_str())
|
||||
.filter(|mt| !handled_types.contains(mt))
|
||||
.filter(|mt| !handled_types.contains(mt) && !mt.starts_with("application/"))
|
||||
.collect();
|
||||
unhandled_types.sort();
|
||||
if !unhandled_types.is_empty() {
|
||||
@ -580,6 +973,13 @@ pub fn walk_attachments_inner<T, F: Fn(&ParsedMail, &[usize]) -> Option<T> + Cop
|
||||
// get the bytes for serving attachments of HTTP
|
||||
pub fn extract_attachments(m: &ParsedMail, id: &str) -> Result<Vec<Attachment>, ServerError> {
|
||||
let mut attachments = Vec::new();
|
||||
|
||||
if m.ctype.mimetype.starts_with("application/") {
|
||||
if let Some(attachment) = extract_attachment(m, id, &[]) {
|
||||
attachments.push(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
for (idx, sp) in m.subparts.iter().enumerate() {
|
||||
if let Some(attachment) = extract_attachment(sp, id, &[idx]) {
|
||||
// Filter out inline attachements, they're flattened into the body of the message.
|
||||
@ -602,12 +1002,30 @@ pub fn extract_attachment(m: &ParsedMail, id: &str, idx: &[usize]) -> Option<Att
|
||||
pct.map(|pct| pct.params.get("name").map(|f| f.clone())),
|
||||
) {
|
||||
// Use filename from Content-Disposition
|
||||
(Some(filename), _) => filename,
|
||||
(Some(filename), _) => Some(filename),
|
||||
// Use filename from Content-Type
|
||||
(_, Some(Some(name))) => name,
|
||||
// No known filename, assume it's not an attachment
|
||||
_ => return None,
|
||||
(_, Some(Some(name))) => Some(name),
|
||||
// No known filename
|
||||
_ => None,
|
||||
};
|
||||
|
||||
let filename = if let Some(fname) = filename {
|
||||
fname
|
||||
} else {
|
||||
if m.ctype.mimetype.starts_with("application/") {
|
||||
// Generate a default filename
|
||||
format!(
|
||||
"attachment-{}",
|
||||
idx.iter()
|
||||
.map(|i| i.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(".")
|
||||
)
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
info!("filename {}", filename);
|
||||
|
||||
// TODO: grab this from somewhere
|
||||
@ -1033,6 +1451,21 @@ pub struct TlsReportTemplate<'a> {
|
||||
pub report: &'a FormattedTlsRpt,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "ical_summary.html")]
|
||||
pub struct IcalSummaryTemplate<'a> {
|
||||
pub summary: &'a str,
|
||||
pub local_fmt_start: &'a str,
|
||||
pub local_fmt_end: &'a str,
|
||||
pub organizer: &'a str,
|
||||
pub organizer_cn: &'a str,
|
||||
pub all_days: Vec<chrono::NaiveDate>,
|
||||
pub event_days: Vec<chrono::NaiveDate>,
|
||||
pub caption: String,
|
||||
pub description_paragraphs: &'a [String],
|
||||
pub today: Option<chrono::NaiveDate>,
|
||||
}
|
||||
|
||||
// Add this helper function to parse the DMARC XML and summarize it.
|
||||
pub fn parse_dmarc_report(xml: &str) -> Result<String, ServerError> {
|
||||
let feedback: Feedback = xml_from_str(xml)
|
||||
@ -1233,24 +1666,196 @@ pub fn pretty_print_xml_with_trimming(xml_input: &str) -> Result<String, ServerE
|
||||
Ok(String::from_utf8(result)?)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::fs;
|
||||
use ical::IcalParser;
|
||||
|
||||
use super::*;
|
||||
pub fn render_ical_summary(ical_data: &str) -> Result<String, ServerError> {
|
||||
let mut summary_parts = Vec::new();
|
||||
let mut parser = IcalParser::new(ical_data.as_bytes());
|
||||
while let Some(Ok(calendar)) = parser.next() {
|
||||
for event in calendar.events {
|
||||
let mut summary = None;
|
||||
let mut description = None;
|
||||
let mut dtstart = None;
|
||||
let mut dtend = None;
|
||||
let mut organizer = None;
|
||||
let mut organizer_cn = None;
|
||||
let mut tzid: Option<String> = None;
|
||||
for prop in &event.properties {
|
||||
match prop.name.as_str() {
|
||||
"SUMMARY" => summary = prop.value.as_deref(),
|
||||
"DESCRIPTION" => description = prop.value.as_deref(),
|
||||
"DTSTART" => {
|
||||
dtstart = prop.value.as_deref();
|
||||
if let Some(params) = &prop.params {
|
||||
if let Some((_, values)) = params.iter().find(|(k, _)| k == "TZID") {
|
||||
if let Some(val) = values.get(0) {
|
||||
tzid = Some(val.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"DTEND" => dtend = prop.value.as_deref(),
|
||||
"ORGANIZER" => {
|
||||
organizer = prop.value.as_deref();
|
||||
if let Some(params) = &prop.params {
|
||||
if let Some((_, values)) = params.iter().find(|(k, _)| k == "CN") {
|
||||
if let Some(cn) = values.get(0) {
|
||||
organizer_cn = Some(cn.as_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_dmarc_report() {
|
||||
let xml = fs::read_to_string("testdata/dmarc-example.xml").unwrap();
|
||||
let html = parse_dmarc_report(&xml).unwrap();
|
||||
assert!(html.contains("hotmail.com"));
|
||||
assert!(html.contains("msn.com"));
|
||||
// Parse start/end as chrono DateTime
|
||||
let (local_fmt_start, local_fmt_end, event_days) = if let Some(dtstart) = dtstart {
|
||||
let tz: Tz = tzid
|
||||
.as_deref()
|
||||
.unwrap_or("UTC")
|
||||
.parse()
|
||||
.unwrap_or(chrono_tz::UTC);
|
||||
let fallback = chrono::DateTime::<chrono::Utc>::from_timestamp(0, 0)
|
||||
.map(|dt| dt.with_timezone(&tz))
|
||||
.unwrap_or_else(|| {
|
||||
tz.with_ymd_and_hms(1970, 1, 1, 0, 0, 0)
|
||||
.single()
|
||||
.unwrap_or_else(|| tz.timestamp_opt(0, 0).single().unwrap())
|
||||
});
|
||||
let start = parse_ical_datetime_tz(dtstart, tz).unwrap_or(fallback);
|
||||
let end = dtend
|
||||
.and_then(|d| parse_ical_datetime_tz(d, tz))
|
||||
.unwrap_or(start);
|
||||
let local_start = start.with_timezone(&Local);
|
||||
let local_end = end.with_timezone(&Local);
|
||||
let allday = dtstart.len() == 8 && (dtend.map(|s| s.len() == 8).unwrap_or(false));
|
||||
let fmt_start = if allday {
|
||||
local_start.format("%a %b %e, %Y").to_string()
|
||||
} else {
|
||||
local_start.format("%-I:%M %p %a %b %e, %Y").to_string()
|
||||
};
|
||||
let fmt_end = if allday {
|
||||
local_end.format("%a %b %e, %Y").to_string()
|
||||
} else {
|
||||
local_end.format("%-I:%M %p %a %b %e, %Y").to_string()
|
||||
};
|
||||
let mut days = vec![];
|
||||
let d = start.date_naive();
|
||||
let mut end_d = end.date_naive();
|
||||
// Check for all-day event (DATE, not DATE-TIME)
|
||||
let allday = dtstart.len() == 8 && (dtend.map(|s| s.len() == 8).unwrap_or(false));
|
||||
if allday {
|
||||
// DTEND is exclusive for all-day events
|
||||
if end_d > d {
|
||||
end_d = end_d.pred_opt().unwrap();
|
||||
}
|
||||
}
|
||||
// Only include actual event days
|
||||
let mut day_iter = d;
|
||||
while day_iter <= end_d {
|
||||
days.push(day_iter);
|
||||
day_iter = day_iter.succ_opt().unwrap();
|
||||
}
|
||||
(fmt_start, fmt_end, days)
|
||||
} else {
|
||||
(String::new(), String::new(), vec![])
|
||||
};
|
||||
|
||||
// Compute calendar grid for template rendering
|
||||
let (all_days, caption) = if !event_days.is_empty() {
|
||||
let first_event = event_days.first().unwrap();
|
||||
let last_event = event_days.last().unwrap();
|
||||
let first_of_month =
|
||||
NaiveDate::from_ymd_opt(first_event.year(), first_event.month(), 1).unwrap();
|
||||
let last_of_month = {
|
||||
let next_month = if last_event.month() == 12 {
|
||||
NaiveDate::from_ymd_opt(last_event.year() + 1, 1, 1).unwrap()
|
||||
} else {
|
||||
NaiveDate::from_ymd_opt(last_event.year(), last_event.month() + 1, 1)
|
||||
.unwrap()
|
||||
};
|
||||
next_month.pred_opt().unwrap()
|
||||
};
|
||||
let mut cal_start = first_of_month;
|
||||
while cal_start.weekday() != chrono::Weekday::Sun {
|
||||
cal_start = cal_start.pred_opt().unwrap();
|
||||
}
|
||||
let mut cal_end = last_of_month;
|
||||
while cal_end.weekday() != chrono::Weekday::Sat {
|
||||
cal_end = cal_end.succ_opt().unwrap();
|
||||
}
|
||||
let mut all_days = vec![];
|
||||
let mut d = cal_start;
|
||||
while d <= cal_end {
|
||||
all_days.push(d);
|
||||
d = d.succ_opt().unwrap();
|
||||
}
|
||||
let start_month = first_event.format("%B %Y");
|
||||
let end_month = last_event.format("%B %Y");
|
||||
let caption = if start_month.to_string() == end_month.to_string() {
|
||||
start_month.to_string()
|
||||
} else {
|
||||
format!("{} – {}", start_month, end_month)
|
||||
};
|
||||
(all_days, caption)
|
||||
} else {
|
||||
(vec![], String::new())
|
||||
};
|
||||
|
||||
// Description paragraphs
|
||||
let description_paragraphs: Vec<String> = if let Some(desc) = description {
|
||||
let desc = desc.replace("\\n", "\n");
|
||||
desc.lines()
|
||||
.map(|line| line.trim().to_string())
|
||||
.filter(|line| !line.is_empty())
|
||||
.collect::<Vec<_>>()
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
let summary_val = summary.unwrap_or("");
|
||||
let organizer_val = organizer.unwrap_or("");
|
||||
let organizer_cn_val = organizer_cn.unwrap_or("");
|
||||
let local_fmt_start_val = &local_fmt_start;
|
||||
let local_fmt_end_val = &local_fmt_end;
|
||||
let description_paragraphs_val = &description_paragraphs;
|
||||
let template = IcalSummaryTemplate {
|
||||
summary: summary_val,
|
||||
local_fmt_start: local_fmt_start_val,
|
||||
local_fmt_end: local_fmt_end_val,
|
||||
organizer: organizer_val,
|
||||
organizer_cn: organizer_cn_val,
|
||||
all_days,
|
||||
event_days: event_days.clone(),
|
||||
caption,
|
||||
description_paragraphs: description_paragraphs_val,
|
||||
today: Some(chrono::Local::now().date_naive()),
|
||||
};
|
||||
summary_parts.push(template.render()?);
|
||||
}
|
||||
}
|
||||
Ok(summary_parts.join("<hr>"))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_dmarc_report_no_envelope_to() {
|
||||
let xml = fs::read_to_string("testdata/dmarc-example-no-envelope-to.xml").unwrap();
|
||||
let html = parse_dmarc_report(&xml).unwrap();
|
||||
assert!(!html.contains("Envelope To"));
|
||||
|
||||
fn parse_ical_datetime_tz(dt: &str, tz: Tz) -> Option<chrono::DateTime<Tz>> {
|
||||
let dt = dt.split(':').last().unwrap_or(dt);
|
||||
if let Ok(ndt) = chrono::NaiveDateTime::parse_from_str(dt, "%Y%m%dT%H%M%SZ") {
|
||||
Some(tz.from_utc_datetime(&ndt))
|
||||
} else if let Ok(ndt) = chrono::NaiveDateTime::parse_from_str(dt, "%Y%m%dT%H%M%S") {
|
||||
match tz.from_local_datetime(&ndt) {
|
||||
LocalResult::Single(dt) => Some(dt),
|
||||
_ => None,
|
||||
}
|
||||
} else if let Ok(nd) = chrono::NaiveDate::parse_from_str(dt, "%Y%m%d") {
|
||||
// All-day event: treat as midnight in local time
|
||||
let ndt = nd.and_hms_opt(0, 0, 0).unwrap();
|
||||
match tz.from_local_datetime(&ndt) {
|
||||
LocalResult::Single(dt) => Some(dt),
|
||||
_ => None,
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +242,9 @@ impl Body {
|
||||
match self {
|
||||
Body::Html(h) => Some(h.html.clone()),
|
||||
Body::PlainText(p) => Some(format!("<pre>{}</pre>", html_escape::encode_text(&p.text))),
|
||||
Body::UnhandledContentType(u) => Some(format!("<pre>{}</pre>", html_escape::encode_text(&u.text))),
|
||||
Body::UnhandledContentType(u) => {
|
||||
Some(format!("<pre>{}</pre>", html_escape::encode_text(&u.text)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -376,11 +376,6 @@ pub async fn thread(
|
||||
current_html.push_str(&html_summary);
|
||||
}
|
||||
|
||||
error!(
|
||||
"mimetype {} raw_report_content.is_some() {}",
|
||||
m.ctype.mimetype.as_str(),
|
||||
raw_report_content.is_some()
|
||||
);
|
||||
if let Some(raw_content) = raw_report_content {
|
||||
let pretty_printed_content = if m.ctype.mimetype.as_str() == MULTIPART_REPORT {
|
||||
// Pretty print JSON
|
||||
@ -479,6 +474,12 @@ pub fn attachment_bytes(nm: &Notmuch, id: &str, idx: &[usize]) -> Result<Attachm
|
||||
let file = File::open(&path)?;
|
||||
let mmap = unsafe { MmapOptions::new().map(&file)? };
|
||||
let m = parse_mail(&mmap)?;
|
||||
if idx.is_empty() {
|
||||
let Some(attachment) = extract_attachment(&m, id, &[]) else {
|
||||
return Err(ServerError::PartNotFound);
|
||||
};
|
||||
return Ok(attachment);
|
||||
}
|
||||
if let Some(attachment) = walk_attachments(&m, |sp, cur_idx| {
|
||||
if cur_idx == idx {
|
||||
let attachment = extract_attachment(&sp, id, idx).unwrap_or(Attachment {
|
||||
@ -811,6 +812,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_parse_tls_report_v1() {
|
||||
let report: TlsRpt = serde_json::from_str(REPORT_V1).unwrap();
|
||||
let _report: TlsRpt = serde_json::from_str(REPORT_V1).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
use askama::Template;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "dmarc_report.html")]
|
||||
pub struct DmarcReportTemplate<'a> {
|
||||
pub feedback: &'a crate::nm::Feedback,
|
||||
}
|
||||
108
server/templates/ical_summary.html
Normal file
108
server/templates/ical_summary.html
Normal file
@ -0,0 +1,108 @@
|
||||
<style>
|
||||
.ical-flex {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: stretch;
|
||||
gap: 0.5em;
|
||||
max-width: 700px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ical-flex .summary-block {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
|
||||
.ical-flex .calendar-block {
|
||||
flex: none;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 599px) {
|
||||
.ical-flex {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.ical-flex>div.summary-block {
|
||||
margin-bottom: 0.5em;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.ical-flex>div.calendar-block {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="ical-flex">
|
||||
<div class="summary-block"
|
||||
style="background:#f7f7f7; border-radius:8px; box-shadow:0 2px 8px #bbb; padding:16px 18px; margin:0 0 8px 0; min-width:220px; max-width:700px; font-size:15px; color:#222;">
|
||||
<div
|
||||
style="display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 0.5em; width: 100%;">
|
||||
<div style="flex: 1 1 220px; min-width: 180px;">
|
||||
<div style="font-size:17px; font-weight:bold; margin-bottom:8px; color:#333;"><b>Summary:</b> {{ summary
|
||||
}}</div>
|
||||
<div style="margin-bottom:4px;"><b>Start:</b> {{ local_fmt_start }}</div>
|
||||
<div style="margin-bottom:4px;"><b>End:</b> {{ local_fmt_end }}</div>
|
||||
{% if !organizer_cn.is_empty() %}
|
||||
<div style="margin-bottom:4px;"><b>Organizer:</b> {{ organizer_cn }}</div>
|
||||
{% elif !organizer.is_empty() %}
|
||||
<div style="margin-bottom:4px;"><b>Organizer:</b> {{ organizer }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if all_days.len() > 0 %}
|
||||
<div class="calendar-block" style="flex: none; margin-left: auto; min-width: 180px;">
|
||||
<table class="ical-month"
|
||||
style="border-collapse:collapse; min-width:220px; background:#fff; box-shadow:0 2px 8px #bbb; font-size:14px; margin:0;">
|
||||
<caption
|
||||
style="caption-side:top; text-align:center; font-weight:bold; font-size:16px; padding-bottom:8px 0;">
|
||||
{{ caption }}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
{% for wd in ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] %}
|
||||
<th
|
||||
style="padding:4px 6px; border-bottom:1px solid #ccc; color:#666; font-weight:600; background:#f7f7f7">
|
||||
{{ wd }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for week in all_days|batch(7) %}
|
||||
<tr>
|
||||
{% for day in week %}
|
||||
{% if event_days.contains(day) && today.is_some() && today.unwrap() == day %}
|
||||
<td
|
||||
style="background:#ffd700; color:#222; font-weight:bold; border:2px solid #2196f3; border-radius:4px; text-align:center; box-shadow:0 0 0 2px #2196f3;">
|
||||
{{ day.day() }}
|
||||
</td>
|
||||
{% elif event_days.contains(day) %}
|
||||
<td
|
||||
style="background:#ffd700; color:#222; font-weight:bold; border:1px solid #aaa; border-radius:4px; text-align:center;">
|
||||
{{ day.day() }}
|
||||
</td>
|
||||
{% elif today.is_some() && today.unwrap() == day %}
|
||||
<td
|
||||
style="border:2px solid #2196f3; border-radius:4px; text-align:center; background:#e3f2fd; color:#222; box-shadow:0 0 0 2px #2196f3;">
|
||||
{{ day.day() }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td style="border:1px solid #eee; text-align:center;background:#f7f7f7;color:#bbb;">
|
||||
{{ day.day() }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if !description_paragraphs.is_empty() %}
|
||||
<div style="max-width:700px; width:100%;">
|
||||
{% for p in description_paragraphs %}
|
||||
<p style="margin: 0 0 8px 0; color:#444;">{{ p }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
169
server/testdata/google-calendar-example.eml
vendored
Normal file
169
server/testdata/google-calendar-example.eml
vendored
Normal file
@ -0,0 +1,169 @@
|
||||
Return-Path: <couchmoney+caf_=gmail=xinu.tv@gmail.com>
|
||||
Delivered-To: bill@xinu.tv
|
||||
Received: from phx.xinu.tv [74.207.253.222]
|
||||
by nixos-01.h.xinu.tv with IMAP (fetchmail-6.4.39)
|
||||
for <wathiede@localhost> (single-drop); Mon, 02 Jun 2025 07:06:34 -0700 (PDT)
|
||||
Received: from phx.xinu.tv
|
||||
by phx.xinu.tv with LMTP
|
||||
id qDo+FuqvPWh51xIAJR8clQ
|
||||
(envelope-from <couchmoney+caf_=gmail=xinu.tv@gmail.com>)
|
||||
for <bill@xinu.tv>; Mon, 02 Jun 2025 07:06:34 -0700
|
||||
X-Original-To: gmail@xinu.tv
|
||||
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::130; helo=mail-lf1-x130.google.com; envelope-from=couchmoney+caf_=gmail=xinu.tv@gmail.com; receiver=xinu.tv
|
||||
Authentication-Results: phx.xinu.tv;
|
||||
dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=zT2yUtVH;
|
||||
dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nmJW8N67
|
||||
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130])
|
||||
by phx.xinu.tv (Postfix) with ESMTPS id 912AC80034
|
||||
for <gmail@xinu.tv>; Mon, 02 Jun 2025 07:06:32 -0700 (PDT)
|
||||
Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-54e7967cf67so5267078e87.0
|
||||
for <gmail@xinu.tv>; Mon, 02 Jun 2025 07:06:32 -0700 (PDT)
|
||||
ARC-Seal: i=2; a=rsa-sha256; t=1748873190; cv=pass;
|
||||
d=google.com; s=arc-20240605;
|
||||
b=W3s0wT+CV1W21AldY9lfxPlKRbc7XMoorEnilNq5iGjlw18vDM6eFPb+btqaGAPOPe
|
||||
CMyGeinsFPuql+S7u6HgjZcf9ZFH71sKoFoQytm30hAXB76GO06qi1jRW6o0miuGt/j/
|
||||
bb8qWAiAsGr34mHIbE5fBdkNOGcqW85oI78GolLqpROgn/42boEYxiGAQjybPtO4L84J
|
||||
wP2RBkHiQQGXUjL6b02tozCji1w2XdfYqtW8RteUs1pqYdXl4GUilMLt5C0d2bhSGksS
|
||||
3tMTFjuycbaj+F6QFCkQfEsHx/I7GjuD4mToLcYpzrNnmZZUidAoKuh+uin0cEVvnQ1j
|
||||
V8aA==
|
||||
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
|
||||
h=to:from:subject:date:message-id:auto-submitted:sender:reply-to
|
||||
:mime-version:dkim-signature:dkim-signature:delivered-to;
|
||||
bh=dgRmOj3aABlB3SNw+xxlI8L9ugJFZ1WMJrtLw/W8tnA=;
|
||||
fh=5zy5Gi9ngAea7dC9ZKKPh/BZlFmotJq74g9KHrEIwaE=;
|
||||
b=QTAjqit0gYnuGa1lbO9RUXOVpyutliNo+tG6irWFsjGhnvMkis2KdLb6saYPnLCG7F
|
||||
rSRXvw0HwuaJfXAV3XvIT0pxTg3PXYnc8kt/F8OtG+LiakJbMV1soj8OJ+5lZPKFmvna
|
||||
i2T5mJjEknZsc9qWYmaAEVqIg71jhPH5CjJyehNhsIJ1/O9CH4VF8L0yv9KUMAA4tzog
|
||||
LfI+SpOE2z/wYuMDxi2Ld3FgaVCQgkMM2Tlys8P0DjCaewWeaZFmZKIEEZUbKWbrivTa
|
||||
RSO+Us+9yrt8hDdJuvtf9eXsGvuZtdj/2APRts/0cd7SFAQqRd0DnhGIHoXR74YVHaqi
|
||||
U7IQ==;
|
||||
darn=xinu.tv
|
||||
ARC-Authentication-Results: i=2; mx.google.com;
|
||||
dkim=pass header.i=@google.com header.s=20230601 header.b=zT2yUtVH;
|
||||
dkim=pass header.i=@gmail.com header.s=20230601 header.b=nmJW8N67;
|
||||
spf=pass (google.com: domain of tconvertino@gmail.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=tconvertino@gmail.com;
|
||||
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
|
||||
dara=pass header.i=@gmail.com
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20230601; t=1748873190; x=1749477990;
|
||||
h=to:from:subject:date:message-id:auto-submitted:sender:reply-to
|
||||
:mime-version:dkim-signature:dkim-signature:delivered-to
|
||||
:x-forwarded-for:x-forwarded-to:x-gm-message-state:from:to:cc
|
||||
:subject:date:message-id:reply-to;
|
||||
bh=dgRmOj3aABlB3SNw+xxlI8L9ugJFZ1WMJrtLw/W8tnA=;
|
||||
b=dBjp6JdmFUj0jKPDo9r2/xvfVSvxKaF15UYwYU7itdM18qpCnrgQdHMP2ST7EQBxou
|
||||
58yZfVjrx84gg9phedpVSg4SaBaPIhXsLuUeVQZtPd7J3WYiH4+OGcecjV+cD0dG0TUi
|
||||
o/FbZULNl3REysvoAj+AwUL/ny2FnNU4PIhkeSq+d6iNztkexIKLS8qWqHosenPlVX+E
|
||||
Z7OGQZpK6m1LB5UbCsaODQq5wbNIxlOxqTP1rCHe/hHk53ljiNegzaOS31mVvp1n8/g1
|
||||
pWIZltyZORs0zi6U9+mNd9ZbaeQjHqBrcb2bsTxCD+u0DBuF2RjLguS/feaB25TG8LAg
|
||||
szYg==
|
||||
X-Forwarded-Encrypted: i=2; AJvYcCXfGRAIDqrPsT1vzTMSiuMrlTj/DbRrr+8w7X+iLRH2XK/n8MZhV3UaT0Zia6c6jMrf3s3eHA==@xinu.tv
|
||||
X-Gm-Message-State: AOJu0YxOQEmNiUg4NKf4NM1BgQMqTJaFM6txPnL6u74ff1dZvoSgTC4d
|
||||
TtJJqfdHsajxloSGDsSPqIQ/M/Se/sfymEExFQxDXYA/XasA6+sdye/Ihl9QekGJK9jet1VtQ3r
|
||||
dcg89xnFcxezg3ji6xH8jnSULlp350K9K7LR0LfTQqg6e/BEKEF8XDaNgmJC+RQ==
|
||||
X-Received: by 2002:a05:6512:2246:b0:553:35bb:f7b7 with SMTP id 2adb3069b0e04-55342f92776mr2472199e87.32.1748873190333;
|
||||
Mon, 02 Jun 2025 07:06:30 -0700 (PDT)
|
||||
X-Forwarded-To: gmail@xinu.tv
|
||||
X-Forwarded-For: couchmoney@gmail.com gmail@xinu.tv
|
||||
Delivered-To: couchmoney@gmail.com
|
||||
Received: by 2002:ab3:7457:0:b0:2b1:14e:dc2b with SMTP id g23csp2818972lti;
|
||||
Mon, 2 Jun 2025 07:06:29 -0700 (PDT)
|
||||
X-Received: by 2002:a05:6602:6a8b:b0:86c:f898:74b8 with SMTP id ca18e2360f4ac-86d0521552emr1082401939f.10.1748873188734;
|
||||
Mon, 02 Jun 2025 07:06:28 -0700 (PDT)
|
||||
ARC-Seal: i=1; a=rsa-sha256; t=1748873188; cv=none;
|
||||
d=google.com; s=arc-20240605;
|
||||
b=d2PNXrTE3VYjml3FmbC5rBW6XnsyuyVO3lPyM6VoVKFcvZ7a8tDRB+sh1ibo0D5Nvg
|
||||
3i/Qon0RV401WFb9NQf5P048wpj19G8bOGPZUKMioBZcSxkr1RwH/GW6GBvGS+d+iqbW
|
||||
43KWc6Px7RGOEeYfp8D88CuJ/5kMcsLMfDV1FRHo6T+chVY6c9fQkHjRreSGQcFXglt5
|
||||
yaCpFKkAODO7rSHl2OW2kQ6eGgR0tUjb95+jdZXoU0GS3119CBYK9n9UhNaeXHIk/Zyy
|
||||
f08r4Ce/m3Y6ISr4ovXxDeYNpeeUN1HT3XVyCVQJHjfWrHypKTiOt4q6yBhCgOgZTXJq
|
||||
pL5A==;
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
|
||||
h=to:from:subject:date:message-id:auto-submitted:sender:reply-to
|
||||
:mime-version:dkim-signature:dkim-signature;
|
||||
bh=dgRmOj3aABlB3SNw+xxlI8L9ugJFZ1WMJrtLw/W8tnA=;
|
||||
fh=mbzrMIWIgWMC0ni1xEx+ViW4J0RLAdLdPT2cX81nTlk=;
|
||||
b=YiMakYeE05UctWy9sW90/a3l1Hk1pAPv0+fpk5vmWrADcMwwI8cHVqBp+Nxds5psWa
|
||||
a/zrw9UlxV4HgjLUP+ella/pK8XxK+sitKg0IhPOntwKbq1KfTNheufh4HtWj5yWedHE
|
||||
sO/dVs6z/EW/gWrfBK/3JMgsnz3HrHmaoJ6caCaGI6t5jHxEXI+eJc5zILY+n0MdivkX
|
||||
tJOo0L1s/k6MAdyLr4/IVqpxdhXbUPq44twCBNheHd8T5w1DC9ZXcr54X79fW8Vzbm8/
|
||||
A++H3gnZRGtOayRySYQl04LFLk4YsisdhsKuaJV+WKYCW58wQqJT04mrVkx+m96qr1q0
|
||||
BQtw==;
|
||||
dara=google.com
|
||||
ARC-Authentication-Results: i=1; mx.google.com;
|
||||
dkim=pass header.i=@google.com header.s=20230601 header.b=zT2yUtVH;
|
||||
dkim=pass header.i=@gmail.com header.s=20230601 header.b=nmJW8N67;
|
||||
spf=pass (google.com: domain of tconvertino@gmail.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=tconvertino@gmail.com;
|
||||
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
|
||||
dara=pass header.i=@gmail.com
|
||||
Received: from mail-sor-f73.google.com (mail-sor-f73.google.com. [209.85.220.73])
|
||||
by mx.google.com with SMTPS id ca18e2360f4ac-86d0213d491sor465078439f.8.2025.06.02.07.06.28
|
||||
for <couchmoney@gmail.com>
|
||||
(Google Transport Security);
|
||||
Mon, 02 Jun 2025 07:06:28 -0700 (PDT)
|
||||
Received-SPF: pass (google.com: domain of tconvertino@gmail.com designates 209.85.220.73 as permitted sender) client-ip=209.85.220.73;
|
||||
Authentication-Results: mx.google.com;
|
||||
dkim=pass header.i=@google.com header.s=20230601 header.b=zT2yUtVH;
|
||||
dkim=pass header.i=@gmail.com header.s=20230601 header.b=nmJW8N67;
|
||||
spf=pass (google.com: domain of tconvertino@gmail.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=tconvertino@gmail.com;
|
||||
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
|
||||
dara=pass header.i=@gmail.com
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=google.com; s=20230601; t=1748873188; x=1749477988; dara=google.com;
|
||||
h=to:from:subject:date:message-id:auto-submitted:sender:reply-to
|
||||
:mime-version:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=dgRmOj3aABlB3SNw+xxlI8L9ugJFZ1WMJrtLw/W8tnA=;
|
||||
b=zT2yUtVHhNy5fFiy6YKzfYCQPlCnufAEoWmbvjvj7mFNYUlLJHZ5FUeNnDs06Z1icR
|
||||
bSVtejKixrz4hjFh9KeKvV9EQNGU7UFgySwqdy6szm+sHZQj+iJAXy85A1QaL6+0Swup
|
||||
2y8QsjVJ96uugM0SaAYZqe+lmLBk6zFWqkg0U37vgwOupAcNsNBd7tos7cxO5eK6Aops
|
||||
FJjr9JAD+ddX03ngH9zfnvlNV/+qbmiP6Hs8OmaJtZof2GLucpHgqUpIdolCh7F72v4p
|
||||
DibO4RShI/IQCw9ejZxhRPBPWQwIdOYLjD/sDunX63M4NCS/63jZfhwqsAVgtmN/cUGq
|
||||
spHQ==
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=gmail.com; s=20230601; t=1748873188; x=1749477988; dara=google.com;
|
||||
h=to:from:subject:date:message-id:auto-submitted:sender:reply-to
|
||||
:mime-version:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=dgRmOj3aABlB3SNw+xxlI8L9ugJFZ1WMJrtLw/W8tnA=;
|
||||
b=nmJW8N67IylgMNprzzf/IC7V2r7xeY0+8Bl0KcAak6Xly+IhVv3nyccvgdKsp+8Ccd
|
||||
NcikfVOtCsE3gTqviReUbTAKy7PyClAbBTEHC0Ne71549BN+v8zX64RpGDFJGX5pJMG5
|
||||
r0Ak88nxzjWkvDLhlnHmWdt/NggdQEI6T7oP4VZo0f0/Ym7g1WJhSItfdIhSRDNzK3ed
|
||||
WPRXUIb1sW3+N0My4Os6L4IA9kdRk5z0qpQxtsIL9N0dzv4q18q6eH3KfTzVPr59PsYT
|
||||
uSgkWoLQZdfA70MMlIRU5CnGbVDRH4TO/ib433vIblOmtLTkQ4EaOTzncbs0tovVes4z
|
||||
evsQ==
|
||||
X-Google-Smtp-Source: AGHT+IETNpLvkLm7t8VAdDcEcVtxFCttPh/uVZhoQCRlhUNlx9bmg67olJiD9EOND8g0z43NnM8iK4FxezZondExIawx
|
||||
MIME-Version: 1.0
|
||||
X-Received: by 2002:a05:6602:4183:b0:864:4a1b:dfc5 with SMTP id
|
||||
ca18e2360f4ac-86d052154eamr1431889339f.9.1748873188195; Mon, 02 Jun 2025
|
||||
07:06:28 -0700 (PDT)
|
||||
Reply-To: tconvertino@gmail.com
|
||||
Sender: Google Calendar <calendar-notification@google.com>
|
||||
Auto-Submitted: auto-generated
|
||||
Message-ID: <calendar-093be1c9-5d94-4994-8bc5-7daa1cfae47b@google.com>
|
||||
Date: Mon, 02 Jun 2025 14:06:28 +0000
|
||||
Subject: New event: Tamara and Scout in Alaska @ Tue Jun 24 - Mon Jun 30, 2025 (tconvertino@gmail.com)
|
||||
From: tconvertino@gmail.com
|
||||
To: couchmoney@gmail.com
|
||||
Content-Type: multipart/alternative; boundary="00000000000023c70606369745e9"
|
||||
|
||||
--00000000000023c70606369745e9
|
||||
Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes
|
||||
Content-Transfer-Encoding: base64
|
||||
|
||||
VGFtYXJhIGFuZCBTY291dCBpbiBBbGFza2ENClR1ZXNkYXkgSnVuIDI0IOKAkyBNb25kYXkgSnVu
|
||||
IDMwLCAyMDI1DQoNCg0KDQpPcmdhbml6ZXINCnRjb252ZXJ0aW5vQGdtYWlsLmNvbQ0KdGNvbnZl
|
||||
cnRpbm9AZ21haWwuY29tDQoNCn5+Ly9+fg0KSW52aXRhdGlvbiBmcm9tIEdvb2dsZSBDYWxlbmRh
|
||||
cjogaHR0cHM6Ly9jYWxlbmRhci5nb29nbGUuY29tL2NhbGVuZGFyLw0KDQpZb3UgYXJlIHJlY2Vp
|
||||
dmluZyB0aGlzIGVtYWlsIGJlY2F1c2UgeW91IGFyZSBzdWJzY3JpYmVkIHRvIGNhbGVuZGFyICAN
|
||||
Cm5vdGlmaWNhdGlvbnMuIFRvIHN0b3AgcmVjZWl2aW5nIHRoZXNlIGVtYWlscywgZ28gdG8gIA0K
|
||||
aHR0cHM6Ly9jYWxlbmRhci5nb29nbGUuY29tL2NhbGVuZGFyL3Ivc2V0dGluZ3MsIHNlbGVjdCB0
|
||||
aGlzIGNhbGVuZGFyLCBhbmQgIA0KY2hhbmdlICJPdGhlciBub3RpZmljYXRpb25zIi4NCg0KRm9y
|
||||
d2FyZGluZyB0aGlzIGludml0YXRpb24gY291bGQgYWxsb3cgYW55IHJlY2lwaWVudCB0byBzZW5k
|
||||
IGEgcmVzcG9uc2UgdG8gIA0KdGhlIG9yZ2FuaXplciwgYmUgYWRkZWQgdG8gdGhlIGd1ZXN0IGxp
|
||||
c3QsIGludml0ZSBvdGhlcnMgcmVnYXJkbGVzcyBvZiAgDQp0aGVpciBvd24gaW52aXRhdGlvbiBz
|
||||
dGF0dXMsIG9yIG1vZGlmeSB5b3VyIFJTVlAuDQoNCkxlYXJuIG1vcmUgaHR0cHM6Ly9zdXBwb3J0
|
||||
Lmdvb2dsZS5jb20vY2FsZW5kYXIvYW5zd2VyLzM3MTM1I2ZvcndhcmRpbmcNCg==
|
||||
--00000000000023c70606369745e9
|
||||
Content-Type: text/html; charset="UTF-8"
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<!doctype html><html xmlns=3D"http://www.w3.org/1999/xhtml" xmlns:v=3D"urn:="...truncated for brevity...
|
||||
57
server/testdata/ical-example-1.ics
vendored
Normal file
57
server/testdata/ical-example-1.ics
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
BEGIN:VCALENDAR
|
||||
METHOD:REQUEST
|
||||
PRODID:Microsoft Exchange Server 2010
|
||||
VERSION:2.0
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:Pacific Standard Time
|
||||
BEGIN:STANDARD
|
||||
DTSTART:16010101T020000
|
||||
TZOFFSETFROM:-0700
|
||||
TZOFFSETTO:-0800
|
||||
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
|
||||
END:STANDARD
|
||||
BEGIN:DAYLIGHT
|
||||
DTSTART:16010101T020000
|
||||
TZOFFSETFROM:-0800
|
||||
TZOFFSETTO:-0700
|
||||
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
|
||||
END:DAYLIGHT
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
ORGANIZER;CN=Bill Thiede:mailto:wthiede@nvidia.com
|
||||
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Bill:mailt
|
||||
o:couchmoney@gmail.com
|
||||
DESCRIPTION;LANGUAGE=en-US:\n
|
||||
UID:040000008200E00074C5B7101A82E00800000000A1458AEA8E4DDB01000000000000000
|
||||
010000000988BC323BE65A8458B718B5EF8FE8152
|
||||
SUMMARY;LANGUAGE=en-US:dentist night guard
|
||||
DTSTART;TZID=Pacific Standard Time:20250108T080000
|
||||
DTEND;TZID=Pacific Standard Time:20250108T090000
|
||||
CLASS:PUBLIC
|
||||
PRIORITY:5
|
||||
DTSTAMP:20241213T184408Z
|
||||
TRANSP:OPAQUE
|
||||
STATUS:CONFIRMED
|
||||
SEQUENCE:0
|
||||
LOCATION;LANGUAGE=en-US:
|
||||
X-MICROSOFT-CDO-APPT-SEQUENCE:0
|
||||
X-MICROSOFT-CDO-OWNERAPPTID:2123132523
|
||||
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
|
||||
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
|
||||
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
|
||||
X-MICROSOFT-CDO-IMPORTANCE:1
|
||||
X-MICROSOFT-CDO-INSTTYPE:0
|
||||
X-MICROSOFT-ONLINEMEETINGEXTERNALLINK:
|
||||
X-MICROSOFT-ONLINEMEETINGCONFLINK:
|
||||
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
|
||||
X-MICROSOFT-DISALLOW-COUNTER:FALSE
|
||||
X-MICROSOFT-REQUESTEDATTENDANCEMODE:DEFAULT
|
||||
X-MICROSOFT-ISRESPONSEREQUESTED:TRUE
|
||||
X-MICROSOFT-LOCATIONS:[]
|
||||
BEGIN:VALARM
|
||||
DESCRIPTION:REMINDER
|
||||
TRIGGER;RELATED=START:-PT5M
|
||||
ACTION:DISPLAY
|
||||
END:VALARM
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
30
server/testdata/ical-example-2.ics
vendored
Normal file
30
server/testdata/ical-example-2.ics
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
BEGIN:VCALENDAR
|
||||
PRODID:-//Google Inc//Google Calendar 70.9054//EN
|
||||
VERSION:2.0
|
||||
CALSCALE:GREGORIAN
|
||||
METHOD:REPLY
|
||||
X-GOOGLE-CALID:g66m0feuqsao8l1c767pvvcg4k@group.calendar.google.com
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20250813T010000Z
|
||||
DTEND:20250813T030000Z
|
||||
DTSTAMP:20250801T022550Z
|
||||
ORGANIZER;CN=Family:mailto:g66m0feuqsao8l1c767pvvcg4k@group.calendar.google
|
||||
.com
|
||||
UID:6os3ap346th6ab9nckp30b9kc8sm2bb160q3gb9l6lgm6or160rjee1mco@google.com
|
||||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=superm
|
||||
atute@gmail.com;X-NUM-GUESTS=0:mailto:supermatute@gmail.com
|
||||
X-GOOGLE-CONFERENCE:https://meet.google.com/dcu-hykx-vym
|
||||
CREATED:20250801T015712Z
|
||||
DESCRIPTION:-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~
|
||||
:~:~:~:~:~:~:~:~::~:~::-\nJoin with Google Meet: https://meet.google.com/dc
|
||||
u-hykx-vym\n\nLearn more about Meet at: https://support.google.com/a/users/
|
||||
answer/9282720\n\nPlease do not edit this section.\n-::~:~::~:~:~:~:~:~:~:~
|
||||
:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~::~:~::-
|
||||
LAST-MODIFIED:20250801T022549Z
|
||||
LOCATION:
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:[tenative] dinner w/ amatute
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
9
server/testdata/ical-multiday.ics
vendored
Normal file
9
server/testdata/ical-multiday.ics
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
SUMMARY:Multi-day Event
|
||||
DTSTART;VALUE=DATE:20250828
|
||||
DTEND;VALUE=DATE:20250831
|
||||
DESCRIPTION:This event spans multiple days.
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
36
server/testdata/ical-straddle-real.ics
vendored
Normal file
36
server/testdata/ical-straddle-real.ics
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
BEGIN:VCALENDAR
|
||||
PRODID:-//Google Inc//Google Calendar 70.9054//EN
|
||||
VERSION:2.0
|
||||
CALSCALE:GREGORIAN
|
||||
METHOD:REQUEST
|
||||
BEGIN:VEVENT
|
||||
DTSTART;VALUE=DATE:20250830
|
||||
DTEND;VALUE=DATE:20250902
|
||||
DTSTAMP:20250819T183713Z
|
||||
ORGANIZER;CN=Bill Thiede:mailto:couchmoney@gmail.com
|
||||
UID:37kplskaimjnhdnt8r5ui9pv7f@google.com
|
||||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
|
||||
TRUE;CN=bill@xinu.tv;X-NUM-GUESTS=0:mailto:bill@xinu.tv
|
||||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
|
||||
;CN=Bill Thiede;X-NUM-GUESTS=0:mailto:couchmoney@gmail.com
|
||||
X-MICROSOFT-CDO-OWNERAPPTID:1427505964
|
||||
CREATED:20250819T183709Z
|
||||
DESCRIPTION:
|
||||
LAST-MODIFIED:20250819T183709Z
|
||||
LOCATION:
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:Test Straddle Month
|
||||
TRANSP:TRANSPARENT
|
||||
BEGIN:VALARM
|
||||
ACTION:DISPLAY
|
||||
DESCRIPTION:This is an event reminder
|
||||
TRIGGER:-P0DT0H30M0S
|
||||
END:VALARM
|
||||
BEGIN:VALARM
|
||||
ACTION:DISPLAY
|
||||
DESCRIPTION:This is an event reminder
|
||||
TRIGGER:-P0DT7H30M0S
|
||||
END:VALARM
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
9
server/testdata/ical-straddle.ics
vendored
Normal file
9
server/testdata/ical-straddle.ics
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
SUMMARY:Straddle Month Event
|
||||
DTSTART;VALUE=DATE:20250830
|
||||
DTEND;VALUE=DATE:20250903
|
||||
DESCRIPTION:This event straddles two months.
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
@ -12,7 +12,7 @@ version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
build-info = "0.0.41"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.34", registry = "xinu" }
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.36", registry = "xinu" }
|
||||
regex = "1.11.1"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
sqlx = "0.8.5"
|
||||
|
||||
@ -33,7 +33,7 @@ wasm-bindgen = "=0.2.100"
|
||||
uuid = { version = "1.16.0", features = [
|
||||
"js",
|
||||
] } # direct dep to set js feature, prevents Rng issues
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.34", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.36", registry = "xinu" }
|
||||
seed_hooks = { version = "0.4.1", registry = "xinu" }
|
||||
strum_macros = "0.27.1"
|
||||
gloo-console = "0.3.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user