daaki-imap
An async IMAP client that takes the specs seriously.
Highlights
- IMAP4rev1 and IMAP4rev2 — support for both RFC 3501 and RFC 9051.
- 30+ extensions — IDLE, CONDSTORE/QRESYNC, MOVE, COMPRESS=DEFLATE, THREAD, OBJECTID, and many more.
- Async with explicit timeouts — built on tokio. Every operation takes a
Duration— no hidden infinite waits. - TLS by default — rustls-based TLS with implicit TLS (port 993) and STARTTLS.
- Zero unsafe code — enforced by
#![deny(unsafe_code)]crate-wide. - Owned types everywhere — all public API types use
String/Vec<u8>.
Quick Start
[]
= "0.1"
Connect, log in, and fetch the subjects of the first 5 messages in INBOX:
use ;
use Duration;
async
IDLE
Wait for new messages without polling. Pass a cancellation token to break out from another task:
# use ;
# use CancellationToken;
# use Duration;
# async
COMPRESS=DEFLATE
Enable wire-level compression — all subsequent traffic is compressed transparently:
# async
Supported Extensions
| Category | Extensions |
|---|---|
| Real-time | IDLE, NOTIFY |
| Search | ESEARCH, SEARCHRES, THREAD, SORT |
| Mailbox management | MOVE, UNSELECT, CHILDREN, SPECIAL-USE, LIST-EXTENDED, LIST-STATUS, STATUS=SIZE, NAMESPACE |
| Message metadata | CONDSTORE, QRESYNC, OBJECTID, SAVEDATE, $Important |
| Append | MULTIAPPEND, APPENDLIMIT, UIDPLUS |
| Encoding & transport | COMPRESS=DEFLATE, BINARY, LITERAL+, UTF8=ACCEPT |
| Access control | ACL, QUOTA, METADATA |
| Auth | SASL-IR, ENABLE, ID |
License
The contents of this package are licensed under the terms of the MIT license.