Skip to content
SPECIFICTION
Get listed

Stalwart mail-parser

github.com

Free plan macOSLinuxSelf-hosted
Visit github.com
Spec score 7.8 #14 of 22 in Email Parsing Software

What it is

Stalwart mail-parser is a free, open-source Rust library for parsing email messages. It supports Internet Message Format RFC 5322, MIME RFC 2045–2049 and other internet messaging RFCs, while attempting to handle messages that depart moderately from those standards. Parsed output includes a MIME tree, text and HTML body lists, and attachments. If one alternative is missing, the library can convert HTML to plain text or plain text to HTML. SIMD kernels accelerate scanning on supported targets, while transfer decoding and charset conversion wait until content is read. Returned strings generally reference the original input message. WHATWG encoding labels are recognized, and the optional full_encoding feature adds legacy multibyte sets including Shift_JIS, Big5 and GB18030. Defaults allow nesting depth 64, 10,000 MIME parts and three decoded nested-message levels. Rust 1.98 is required. No feature is enabled by default; serde adds serialization. The library is licensed under MIT or Apache-2.0 and costs nothing.

Spec sheet

What it does
mail-parser is a Rust library for parsing email messages and conforms to RFC 5322 and MIME RFCs 2045–2049.Read 9 Oct 2026 · github.com
License
The library is available under either the Apache License 2.0 or the MIT license, at the user's option.Read 9 Oct 2026 · github.com
Build requirement
The minimum supported Rust version is 1.98, and no feature flags are enabled by default.Read 9 Oct 2026 · github.com
Character sets
It recognizes 41 character sets, with additional legacy multibyte charset decoding available through the optional full_encoding feature.Read 9 Oct 2026 · github.com
Charsets
The library recognizes WHATWG encoding labels, and its optional full_encoding feature adds support for legacy multibyte character sets including Shift_JIS, Big5, and GB18030.Read 4 Oct 2026 · github.com
Compatibility
The parser attempts to parse nonconforming messages when they do not deviate too far from the standard.Read 9 Oct 2026 · github.com
Integration
The library is used in production by Stalwart Mail Server.Read 9 Oct 2026 · github.com
Limits
The parser defaults to a nesting depth of 64, 10,000 MIME parts, and three levels of transfer-encoded nested messages.Read 9 Oct 2026 · github.com
Memory use
The project describes the parser as zero-copy, with practically all returned strings referencing the raw input message.Read 9 Oct 2026 · github.com
Message bodies
It exposes text, HTML, and attachment body lists, and converts HTML to plain text or plain text to HTML when the other format is absent.Read 9 Oct 2026 · github.com
Message content
It provides a MIME tree and lists of text bodies, HTML bodies, and attachments; it can convert HTML to plain text and plain text to HTML when an alternative is absent.Read 4 Oct 2026 · github.com
Not a message builder
The library does not build email messages; the README points to the separate mail-builder crate for that functionality.Read 4 Oct 2026 · github.com
Not included
The library does not build email messages; the project points to the separate mail-builder crate for that functionality.Read 9 Oct 2026 · github.com
Optional features
No Cargo feature is enabled by default; the optional serde feature adds serialization support for Message and related types.Read 4 Oct 2026 · github.com
Parser limits
Defaults include a nesting depth of 64, up to 10,000 MIME parts, and up to 3 levels of decoded nested messages.Read 4 Oct 2026 · github.com
Performance
The parser uses SIMD kernels for boundary and header scanning on supported targets and decodes message content lazily when it is read.Read 9 Oct 2026 · github.com
Performance design
It uses SIMD kernels on supported targets and defers transfer decoding and charset conversion until content is read.Read 4 Oct 2026 · github.com
Production use
The README says mail-parser is used in production environments worldwide by Stalwart Mail Server.Read 4 Oct 2026 · github.com
Robust parsing
The library aims to parse non-conformant email messages when they do not deviate too far from the standard.Read 4 Oct 2026 · github.com
Rust requirement
The minimum supported Rust version is 1.98.Read 4 Oct 2026 · github.com
Security testing
The project says every library function has been fuzzed and tested with MIRI.Read 4 Oct 2026 · github.com
Testing and security
The project says every library function has been fuzzed and thoroughly tested with MIRI.Read 9 Oct 2026 · github.com

Plans and prices

mail-parser Free No paid plan or usage limits stated on the repository page Read 9 Oct 2026 · github.com
Open-source library Free Rust email parsing library · MIT or Apache-2.0 license Read 4 Oct 2026 · github.com

Every Stalwart mail-parser plan and price →

Strong points and limits

Strong points

  • Supports RFC 5322 and MIME
  • Provides text, HTML and attachment lists
  • Lazy decoding and SIMD scanning
  • Optional legacy charset support
  • MIT or Apache-2.0 licensing

Limits

  • Requires Rust 1.98 or later
  • Parser defaults limit nesting and MIME parts
  • Does not build email messages
  • No Cargo feature is enabled by default

Who it suits

It suits Rust developers building email-processing systems on Linux, macOS or self-hosted environments. It is for parsing messages and attachments, not constructing outbound email.

Verdict

mail-parser focuses on standards-aware email parsing with explicit limits, charset options and attachment handling. Developers needing message creation must use the separate mail-builder crate.

Where Specifiction places it

Alternatives to Stalwart mail-parserAll alternatives →