Skip to content

Sync fork with current imap-proto main - #1

Draft
gabeosx wants to merge 17 commits into
rustmailer:mainfrom
gabeosx:codex/rustmailer-main-sync
Draft

Sync fork with current imap-proto main#1
gabeosx wants to merge 17 commits into
rustmailer:mainfrom
gabeosx:codex/rustmailer-main-sync

Conversation

@gabeosx

@gabeosx gabeosx commented Jul 29, 2026

Copy link
Copy Markdown

Summary

Bring rustmailer/tokio-imap up to the current djc/imap-proto main
history.

The Rustmailer fork is 17 commits behind its parent and has no fork-only
commits, so this is a clean fast-forward from
b71fcba772ececaf2e5afdfc6e8fcdec171bf671 to
9271e64059d905a09e1fa9a38bc0d8bfb237c875.

Why this is separate

This is the first dependency step for rustmailer/bichon#333. Keeping the fork
update separate prevents the UIDONLY parser PR from mixing 17 upstream
maintenance commits into its feature review.

Verification

  • cargo fmt --all -- --check
  • cargo test --all-features: 90 passed
  • cargo clippy --all-targets -- -D warnings

Follow-up

The UIDONLY parser support is #2, based on this branch.

rustmailer and others added 17 commits April 21, 2026 09:27
Real-world IMAP servers (Dovecot, Cyrus) regularly emit 8-bit bytes in
BODYSTRUCTURE responses — typically MIME filenames in non-UTF-8
encodings like Latin-1 or ISO-8859-9 (e.g. Turkish "Görüntü1.png" from
Outlook). The strict 7-bit ASCII parser rejected these, breaking the
parse of a single bad mail and desyncing the entire bulk fetch
stream.

Two changes:

1. `is_char` now accepts any non-NUL byte instead of only US-ASCII.
   Real-world server behavior, and RFC 6855 / IMAP4rev2 (RFC 9051)
   formally allow UTF-8 in these positions.

2. The `*_utf8` parser functions (`string_utf8`, `nstring_utf8`,
   `astring_utf8`, `quoted_utf8`, `text`) now use
   `String::from_utf8_lossy` and return `Cow<'_, str>`, falling back
   to lossy decoding when bytes are not valid UTF-8 instead of
   failing the entire parse.

Callers that previously wrapped `&str` results in `Cow::Borrowed`
have been simplified to take the `Cow<'_, str>` directly. Tests
updated to match the new return types.

Adds a regression test (`test_body_structure_with_8bit_literal_filename`)
that reproduces the original failure: a BODYSTRUCTURE with
`("name" {8}\r\nGörüntü1)` (Turkish filename in Latin-1) now parses
successfully via lossy decoding.
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6 to 7.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v6...v7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
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.

4 participants