Fixes against real-world usage: Bounded literal reads, LOGIN tag isolation - #141
Fixes against real-world usage: Bounded literal reads, LOGIN tag isolation#141Pzixel wants to merge 2 commits into
Conversation
Carried over from the email-stats vendored copy of 0.11.3: - ImapStream::new_with_max_response_size and read_response_with_literal_prefix: read one response while retaining only a bounded prefix of a server-declared literal larger than the limit; a capped outcome closes the response stream. New LiteralAwareResponse and LiteralPrefix types carry the outcome. - LOGIN completion matching only considers the tag of the LOGIN request; completions for other tags are ignored (test added).
2da4626 to
1487607
Compare
Collapse the nested `if let` in `login` and in the literal-prefix decode path into let-chains, and reformat the affected block. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Are you using If it is a proxy or server bug and it somehow sends responses with tags that were never requested or duplicates them, could you report this to https://github.com/modern-email/defects/issues with all the details such as the version of the proxy/server that is doing this? I have extracted this fix into #142 for easier review since it is basically a one-line change. |
|
Answering directly: no pipelining, no The source was a third-party IMAP proxy we don't control, which we've since blocked outright. I don't have a wire trace saved Still worth fixing on this side, since #142 is fine, please land it. Note that here is another change in this PR for bounded literal reads: at ~1000 concurrent sessions doing |
Two changes that turned out to be required in real-world use against a large fleet of mailboxes behind an IMAP proxy, some of them on misbehaving servers.