jonhoo / jonhoo/rust-imap

parse error in `noop` loop from "seen" event from server

Open
#128 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
583
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Pretty easy to reproduce:

```rust
let mailbox = imap_session.examine("[Gmail]/All Mail")?;
loop {
println!("tick");
if let Ok(response) = imap_session.unsolicited_responses.try_recv() {
println!("response: {:?}", response);
match response {
UnsolicitedResponse::Recent(id) | UnsolicitedResponse::Exists(id) => {
print_email(&mut imap_session, id)?;
}
other => {
println!("Other {:?}", other);
}
}
}
std::thread::sleep(std::time::Duration::from_secs(1));
imap_session.noop()?;
}
```

While in this loop, read an email and notice that the process exits with the following error:

`Error: Imap(Parse(Unexpected("Fetch(31724, [Uid(85608), Flags([\"\\\\Seen\"])])")))`

It seems like this is a bug in not adding it to the unsolicited events. This is with a Gmail server.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.