Skip to content

Upgrade imap-proto to 0.17.x to fix parsing LOGIN response with an en dash - #144

Merged
link2xt merged 2 commits into
mainfrom
link2xt/login-en-dash
Sep 30, 2026
Merged

link2xt merged 2 commits into
mainfrom
link2xt/login-en-dash

Conversation

@link2xt

@link2xt link2xt commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #145

The bug is fixed upstream, so this PR is upgrading imap-proto to 0.17.0, but also adds a test that was previously failing to avoid regressions.

@link2xt link2xt added the bug Something isn't working label Sep 15, 2026
@link2xt
link2xt force-pushed the link2xt/login-en-dash branch from 73f3c40 to 1244a72 Compare September 15, 2026 04:26
@link2xt link2xt changed the title test: add a failing test for LOGIN response with en-dash Upgrade imap-proto to 0.17.x to fix parsing LOGIN response with an en dash Sep 15, 2026
@link2xt
link2xt force-pushed the link2xt/login-en-dash branch from 1244a72 to 5aaba9e Compare September 15, 2026 04:31
@link2xt
link2xt force-pushed the link2xt/login-en-dash branch from 5aaba9e to fbd55f8 Compare September 28, 2026 16:43
@link2xt
link2xt force-pushed the link2xt/login-en-dash branch from fbd55f8 to ebff05a Compare September 28, 2026 16:45
@link2xt
link2xt marked this pull request as ready for review September 28, 2026 16:50
@link2xt
link2xt requested a review from Hocuri September 28, 2026 16:50
@link2xt link2xt removed the bug Something isn't working label Sep 28, 2026

@hpk42 hpk42 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, two probably minor comments.

Also before merging would be good to check that core compiles against it and do any neccessary fixes (i haven't done that myself).

Comment thread src/client.rs
#[cfg_attr(feature = "runtime-tokio", tokio::test)]
#[cfg_attr(feature = "runtime-async-std", async_std::test)]
async fn login_with_capabilities_and_en_dash() {
let response = b"A0001 OK [CAPABILITY IMAP4rev1 LOGIN-REFERRALS ID ENABLE IDLE SASL-IR LITERAL+ AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2] Logged in \xe2\x80\x93 go ahead!\r\n".to_vec();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this uses a tagged response while in #145 it's untagged

* OK [CAPABILITY IMAP4rev1 LOGIN-REFERRALS ID ENABLE IDLE SASL-IR
LITERAL+ AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2] Logged in – go ahead!

it's probably ok and touches the same code paths? Still would be better if the test covers the exact bytes reported in the issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It likely failed here while reading pre-login banner: https://github.com/chatmail/core/blob/736979b451cd9a2b8f8a2c59b1f10602038a6148/src/imap/client.rs#L239-L242

I added another test for the banner, calling read_response() directly.

Comment thread Cargo.toml
@@ -1,3 +1,3 @@
[package]
name = "async-imap"
version = "0.11.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably should be bumbed to 0.12.0 as imap_proto is part of the exported api, and we bump it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update it to 0.12.0 when releasing.

@link2xt

link2xt commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Also before merging would be good to check that core compiles against it and do any neccessary fixes (i haven't done that myself).

Opened chatmail/core#8769, it compiles with a minor change.

@link2xt
link2xt merged commit b149847 into main Sep 30, 2026
28 checks passed
@link2xt
link2xt deleted the link2xt/login-en-dash branch September 30, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing to parse en dash (\xe2\x80\x93) in LOGIN response

2 participants