check status

This commit is contained in:
Quentin 2023-12-30 10:35:01 +01:00
parent 608dab8e5d
commit 3004c69822
Signed by: quentin
GPG key ID: E9602264D639FF68
3 changed files with 5 additions and 48 deletions

47
Cargo.lock generated
View file

@ -57,7 +57,6 @@ dependencies = [
"rmp-serde",
"rpassword",
"serde",
"serial_test",
"smtp-message",
"smtp-server",
"sodiumoxide",
@ -1225,19 +1224,6 @@ dependencies = [
"typenum",
]
[[package]]
name = "dashmap"
version = "5.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
dependencies = [
"cfg-if",
"hashbrown 0.14.3",
"lock_api",
"once_cell",
"parking_lot_core",
]
[[package]]
name = "data-encoding"
version = "2.4.0"
@ -1630,12 +1616,6 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
[[package]]
name = "hdrhistogram"
version = "7.5.2"
@ -1833,7 +1813,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
"hashbrown",
]
[[package]]
@ -2811,31 +2791,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serial_test"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d"
dependencies = [
"dashmap",
"futures",
"lazy_static",
"log",
"parking_lot",
"serial_test_derive",
]
[[package]]
name = "serial_test_derive"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.27",
]
[[package]]
name = "sha1"
version = "0.10.6"

View file

@ -52,7 +52,6 @@ smtp-server = { git = "http://github.com/Alexis211/kannader", branch = "feature/
#imap-flow = { git = "https://github.com/duesee/imap-flow.git", commit = "e45ce7bb6ab6bda3c71a0c7b05e9b558a5902e90" }
[dev-dependencies]
serial_test = "*"
[[test]]
name = "imap_features"

View file

@ -97,7 +97,7 @@ fn generic_test(imap_socket: &mut TcpStream, lmtp_socket: &mut TcpStream) -> Res
select_inbox(imap_socket).context("select inbox")?;
// CHECK IS NOT IMPLEMENTED YET
//check(...)
status_mailbox(imap_socket).context("status inbox")?;
status_mailbox(imap_socket).context("status of archive from inbox")?;
lmtp_handshake(lmtp_socket).context("handshake lmtp done")?;
lmtp_deliver_email(lmtp_socket, EMAIL).context("mail delivered successfully")?;
noop_exists(imap_socket).context("noop loop must detect a new email")?;
@ -187,6 +187,9 @@ fn select_inbox(imap: &mut TcpStream) -> Result<()> {
}
fn status_mailbox(imap: &mut TcpStream) -> Result<()> {
imap.write(&b"25 STATUS archive (UIDNEXT MESSAGES)\r\n"[..])?;
let mut buffer: [u8; 6000] = [0; 6000];
let _read = read_lines(imap, &mut buffer, Some(&b"25 OK"[..]))?;
Ok(())
}