Skip to content

Session::{fetch, uid_fetch}() fails to read full response and corrupts session #66

@tp971

Description

@tp971

I'm not entirely sure what the issue is, however I have tried downloading a mailbox with thousands of mails and this occured: on a very big message, the result of session.uid_fetch(...).await?.try_next().await? returned None and the next request broke the connection with the error: io: inner stream closed. I did some further inspection with RUST_LOG=trace and found out that on every message I try to fetch which causes this error, the following happens:

[2022-12-17T16:05:25Z TRACE async_imap::imap_stream] decode: input: Ok("* 343 FETCH (INTERNALDATE ... some very long data and an HTML email ... </body>\r\n</html>\r\n UID ")
[2022-12-17T16:05:25Z TRACE async_imap::imap_stream] decode: incomplete data, need minimum 1 bytes

After that, it just return None and the next request returns an error. There seems to be an issue whenever the current input buffer ends with " UID ", because the only messages that ended with " UID " were the ones that caused this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions