Implement IMAP fetch internaldate
This commit is contained in:
parent
b15026ec9c
commit
7efe08a9b8
3 changed files with 39 additions and 11 deletions
38
Cargo.lock
generated
38
Cargo.lock
generated
|
@ -26,6 +26,7 @@ dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64",
|
"base64",
|
||||||
"boitalettres",
|
"boitalettres",
|
||||||
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"duplexify",
|
"duplexify",
|
||||||
"futures",
|
"futures",
|
||||||
|
@ -247,6 +248,27 @@ dependencies = [
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-stream"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e"
|
||||||
|
dependencies = [
|
||||||
|
"async-stream-impl",
|
||||||
|
"futures-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-stream-impl"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-task"
|
name = "async-task"
|
||||||
version = "4.2.0"
|
version = "4.2.0"
|
||||||
|
@ -403,10 +425,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "boitalettres"
|
name = "boitalettres"
|
||||||
version = "0.0.1"
|
version = "0.1.0"
|
||||||
source = "git+https://git.deuxfleurs.fr/KokaKiwi/boitalettres.git?branch=main#01ee8c872b15e2aecb4c0ef5c2dd3aa6cc3c4d3c"
|
source = "git+https://git.deuxfleurs.fr/quentin/boitalettres.git?branch=expose-mydatetime#874fa91186989ced7ebac270f18b64e47ee4f98a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-compat",
|
"async-compat",
|
||||||
|
"async-stream",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures",
|
"futures",
|
||||||
"imap-codec",
|
"imap-codec",
|
||||||
|
@ -1130,8 +1153,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "imap-codec"
|
name = "imap-codec"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/superboum/imap-codec.git?branch=v0.5.x#09f18cff93b7e17e5b84ab1fbf06b8d13b8e9e2d"
|
||||||
checksum = "cab1edebd5f2288f8c195ae53fbb7342f5e568739b439a5923be21a9f61f3364"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"abnf-core",
|
"abnf-core",
|
||||||
"base64",
|
"base64",
|
||||||
|
@ -1354,9 +1376,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miette"
|
name = "miette"
|
||||||
version = "4.7.1"
|
version = "5.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c"
|
checksum = "6ec753a43fd71bb5f28751c9ec17fbe89d6d26ca8282d1e1f82f5ac3dbd5581e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"miette-derive",
|
"miette-derive",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -1366,9 +1388,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miette-derive"
|
name = "miette-derive"
|
||||||
version = "4.7.1"
|
version = "5.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c"
|
checksum = "fdfc33ea15c5446600f91d319299dd40301614afff7143cdfa9bf4c09da3ca64"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
@ -39,10 +39,12 @@ zstd = { version = "0.9", default-features = false }
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tower = "0.4"
|
tower = "0.4"
|
||||||
imap-codec = "0.5"
|
|
||||||
|
imap-codec = { git = "https://github.com/superboum/imap-codec.git", branch = "v0.5.x" }
|
||||||
|
chrono = { version = "0.4", default-features = false, features = ["alloc"] }
|
||||||
|
|
||||||
k2v-client = { git = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git", branch = "main" }
|
k2v-client = { git = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git", branch = "main" }
|
||||||
boitalettres = { git = "https://git.deuxfleurs.fr/KokaKiwi/boitalettres.git", branch = "main" }
|
boitalettres = { git = "https://git.deuxfleurs.fr/quentin/boitalettres.git", branch = "expose-mydatetime" }
|
||||||
smtp-message = { git = "http://github.com/Alexis211/kannader", branch = "feature/lmtp" }
|
smtp-message = { git = "http://github.com/Alexis211/kannader", branch = "feature/lmtp" }
|
||||||
smtp-server = { git = "http://github.com/Alexis211/kannader", branch = "feature/lmtp" }
|
smtp-server = { git = "http://github.com/Alexis211/kannader", branch = "feature/lmtp" }
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,10 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::{anyhow, bail, Error, Result};
|
use anyhow::{anyhow, bail, Error, Result};
|
||||||
use boitalettres::proto::res::body::Data as Body;
|
use boitalettres::proto::res::body::Data as Body;
|
||||||
|
use chrono::{Offset, Utc, TimeZone};
|
||||||
use futures::stream::{FuturesOrdered, StreamExt};
|
use futures::stream::{FuturesOrdered, StreamExt};
|
||||||
use imap_codec::types::address::Address;
|
use imap_codec::types::address::Address;
|
||||||
|
use imap_codec::types::datetime::MyDateTime;
|
||||||
use imap_codec::types::core::{Atom, IString, NString, NonZeroBytes};
|
use imap_codec::types::core::{Atom, IString, NString, NonZeroBytes};
|
||||||
use imap_codec::types::envelope::Envelope;
|
use imap_codec::types::envelope::Envelope;
|
||||||
use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes};
|
use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes};
|
||||||
|
@ -288,7 +290,9 @@ impl MailboxView {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
FetchAttribute::InternalDate => {
|
FetchAttribute::InternalDate => {
|
||||||
todo!()
|
attributes.push(MessageAttribute::InternalDate(
|
||||||
|
MyDateTime(Utc.fix().timestamp(i64::try_from(meta.internaldate / 1000)?, 0))
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue