chatmail / chatmail/async-imap

Fetching a body section fails with "incomplete data, need minimum X bytes"

Open
#71 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
147
Forks
42
Avg merge
8d 15h
Merged PRs (30d)
1

Description

Running any of these:
(with any valid uid)
```rs
let mails: Vec<_> = session.uid_fetch("22213", "BODY.PEEK[1]").await?.try_collect().await?;
let mails: Vec<_> = session.uid_fetch("22213", "BODY[1]").await?.try_collect().await?;
```

causes no body, text or any other data to be parsed, and the trace shows it hitting this:
https://github.com/async-email/async-imap/blob/60ed0ffe357abffb7bdbac0b89ce49e87880a308/src/imap_stream.rs#L123

The `need minimum X bytes` is always a little lower than the size of the data returned. In this case 220 bytes returned, but it says `minimum 130`.

Run with gmail imap servers, with this crate setup:
```toml
async-imap = { version = "0.6.0", default-features = false, features = ["runtime-tokio"] }
```

calling `BODY[]` or `BODY.PEEK[]` or any other call works fine.

Connecting to the imap server directly like so:
```sh
openssl s_client -connect imap.gmail.com:993 -crlf
```
and running the same commands (with same UIDs) seems to work fine.

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.