Skip to content

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

@t348575

Description

@t348575

Running any of these:
(with any valid uid)

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:

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:

openssl s_client -connect imap.gmail.com:993 -crlf

and running the same commands (with same UIDs) seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions