daaki-smtp
A Rust SMTP/LMTP client built with tokio & rustls.
Highlights
- SMTP and LMTP — support for RFC 5321 and RFC 2033.
- Pipelining — batches commands automatically when the server advertises it.
- CHUNKING/BINARYMIME — send large or binary messages via BDAT without dot-stuffing.
- Async with explicit timeouts — built on tokio. Every operation takes a
Duration. - TLS by default — rustls-based TLS with implicit TLS (port 465) and STARTTLS.
- Typed API — validated newtypes (
ReversePath,ForwardPath,Domain,Mailbox) and typed results (SendResult,LmtpSendResult) catch errors at construction time. - Zero unsafe code — enforced by
#![deny(unsafe_code)]crate-wide. - Optional serde — enable the
serdefeature forSerialize/Deserializeon all public types.
Quick Start
[]
= "0.2"
Connect, authenticate, and send a message:
use ;
use Duration;
async
LMTP
Connect to an LMTP server for local delivery. Returns per-recipient results:
# use ;
# use Duration;
# async
Supported Extensions
| Category | Extensions | RFCs |
|---|---|---|
| Content encoding | 8BITMIME, CHUNKING, BINARYMIME | RFC 1652, 3030 |
| Transport | PIPELINING, SIZE, STARTTLS, Implicit TLS | RFC 1854, 1870, 3207, 8314 |
| Auth | AUTH (PLAIN, LOGIN, OAUTHBEARER, XOAUTH2) | RFC 4954, 4616, 7628 |
| Delivery | DSN (NOTIFY, ORCPT, RET, ENVID), REQUIRETLS, DELIVERBY, FUTURERELEASE, MT-PRIORITY | RFC 3461, 8689, 2852, 4865, 6758 |
| Status & addressing | ENHANCEDSTATUSCODES, SMTPUTF8, VRFY, EXPN, NO-SOLICITING | RFC 2034, 6531, 5321, 3865 |
Compatibility note: some servers advertise a legacy, non-standard SASL-IR
EHLO keyword. daaki-smtp preserves it for introspection, but RFC 4954
Section 4 already allows SMTP AUTH initial responses without a separate
standard extension.
License
The contents of this package are licensed under the terms of the MIT license.