imap-rs
A modern, high-performance, and security-first IMAP library for Rust.
Project Status & Call for Maintainers
Heads-up:
imap-rshas so far been mainly "vibe coded" — built rapidly with heavy AI assistance rather than by a seasoned IMAP/Rust team. It compiles cleanly, is panic-free in its production paths, and ships with unit + integration tests, a parser fuzz target, CI, and security hardening (rustls-only TLS,zeroized credentials,#![forbid(unsafe_code)]across all crates). However, it has not yet been battle-tested in production or independently audited.
I'm now looking for Senior Rust developers to help maintain and steward this project long-term — reviewing the architecture and protocol correctness, hardening edge cases, expanding IMAP4rev2 / extension coverage, and guiding releases.
If you have deep Rust and/or IMAP experience and want to get involved:
- Open or comment on a GitHub issue, or start a discussion
- Let me know you're interested in a maintainer role
- See CONTRIBUTING.md for the development workflow, quality bar, and coding standards
Contributions of every size are welcome — but experienced maintainer reviews are what the project needs most right now.
Features
- Security First: 100% Safe Rust. Built-in protection against credential leaks using
zeroize. - Memory Safe TLS: Exclusively uses
rustls(no OpenSSL or Native-TLS). - Zero-Copy Parser: Hand-rolled recursive descent parser for maximum performance without allocations.
- Typed State Machine: Leverages Rust's type system to enforce valid IMAP command sequences at compile-time.
- IMAP4rev2 Ready: Designed for RFC 9051 with backward compatibility via automatic capability negotiation.
- Async Native: Built on
tokiofor high-concurrency workloads.
Project Structure
The project is split into three core crates to ensure a clean separation of concerns. The imap-rs umbrella crate re-exports all three:
imap-rs-core(re-exported asimap_rs::core): Protocol types, AST, and the zero-copy parser (no I/O).imap-rs-client(re-exported asimap_rs::client): Async session management, command pipelining, and state machine.imap-rs-tls(re-exported asimap_rs::tls): High-level secure connection wrapper usingrustls.
Usage
Add this to your Cargo.toml:
[]
= "0.2"
Basic Example
use connect_tls;
use Password;
async
STARTTLS
let session = connect_starttls.await?;
// Capabilities are *only* trusted from inside the TLS channel.
Development & Testing
Toolchain
This project is pinned to Rust 1.95.0 to ensure consistent diagnostic output for UI tests (trybuild). A rust-toolchain.toml file is included in the repository.
Running Tests
To run all tests (including state-machine validation):
Coverage
We use cargo-tarpaulin for coverage. You can run it on the stable toolchain:
Troubleshooting UI Tests
If you see a mismatch error in tests/ui/ after updating the compiler or changing error messages, you can "bless" the new output:
TRYBUILD=overwrite
Verify the changes with git diff before committing.
Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
Security
Please see SECURITY.md for our vulnerability disclosure policy.
License
Licensed under the MIT license.