FREEDOM251

Freedom251 › Email Parsing Software

Stalwart mail-parser

Free plan LinuxMacSelf-hosted

Visit Stalwart mail-parser Alternatives Pricing

Stalwart mail-parser's own site

What Stalwart mail-parser is

Stalwart mail-parser is a free Rust library for parsing email messages. It supports Internet Message Format (RFC 5322), MIME (RFC 2045–2049), and other internet messaging RFCs, and aims to handle messages that stray from the standards without departing too far. Its output includes a MIME tree, text and HTML bodies, and attachments. When a message lacks one content alternative, the library can convert HTML to plain text or plain text to HTML.

On supported targets, mail-parser uses SIMD kernels. It postpones transfer decoding and character-set conversion until content is read, and practically all returned strings refer to the raw message input. It recognizes WHATWG encoding labels; the optional full_encoding feature adds legacy multibyte character sets such as Shift_JIS, Big5, and GB18030. Default limits include a nesting depth of 64, up to 10,000 MIME parts, and up to three levels of decoded nested messages. Cargo features are disabled by default, while the optional serde feature adds serialization support for Message and related types. The library requires Rust 1.98 or later and is offered under either the MIT License or Apache License 2.0. It parses attachments but does not build email messages; mail-builder is a separate crate for that purpose.

Who it suits

This library suits Rust developers who need to parse email messages, inspect MIME structure, or retrieve text, HTML, and attachment content. It is also relevant where input may be imperfectly formatted or where legacy character sets and explicit parser limits matter.

What it does well

  • Supports Internet Message Format and MIME standards.
  • Returns MIME structure, body content, and attachments.
  • Can generate a text or HTML alternative when one is absent.
  • Optional support covers legacy multibyte character sets.
  • Available under MIT or Apache-2.0 licensing.

What to know first

  • Requires Rust 1.98 or later.
  • Does not build email messages.
  • Legacy multibyte character sets require the optional full_encoding feature.
  • Default limits cap MIME parts at 10,000 and nesting at 64.

Limits

Default parser limits are a nesting depth of 64, up to 10,000 MIME parts, and up to three levels of decoded nested messages. Legacy multibyte charset support requires the optional full_encoding feature.

Plans

PlanBilled and limitsPrice
Open-source libraryRust email parsing library · MIT or Apache-2.0 licenseFree
mail-parserNo paid plan or usage limits stated on the repository pageFree

As github.com lists them, read 4 Oct 2026. The maker's own page has the final word.

Getting started

  1. Open the Stalwart mail-parser project on GitHub.
  2. Use the library in a Rust project that meets the Rust 1.98 minimum requirement.
  3. Enable optional Cargo features such as full_encoding or serde if needed.

Stalwart mail-parser is a Rust library for extracting structure and content from email messages. It is best suited to developers building Rust software that needs to inspect incoming mail; its focused parsing role makes it a less complete fit for broader mail workflows.

Overview

The library handles Internet Message Format (RFC 5322), MIME (RFC 2045–2049) and related internet messaging standards. It tries to recover messages that depart from those standards without straying too far, useful when real-world mail is imperfect but not a substitute for handling arbitrary malformed input.

Parsing happens within the Rust application, producing structured message parts for the application to use. The boundary is clear: mail-parser reads messages but does not build them; the project points to the separate mail-builder crate for composition.

Key features

MIME bodies and attachments

The parser exposes a MIME tree and lists of text bodies, HTML bodies and attachments. It can convert HTML to plain text, or plain text to HTML, when the other format is absent. That gives an application a fallback representation for messages that provide only one body format, while leaving presentation decisions to the application.

Parsing performance and memory

On supported targets, SIMD kernels scan boundaries and headers. Transfer decoding and character conversion are delayed until content is read, and nearly all returned strings reference the raw input message. Together, these choices are aimed at limiting unnecessary work and copies; the benefit is most relevant to applications processing messages without needing every body immediately.

Character sets and optional capabilities

The library recognizes 41 character sets and WHATWG encoding labels. Enabling the optional full_encoding feature adds decoding for legacy multibyte sets including Shift_JIS, Big5 and GB18030. No Cargo feature is enabled by default, so projects must opt into extra capabilities such as full_encoding or serde, which adds serialization support for Message and related types.

Limits and security testing

Default parser limits include a nesting depth of 64, up to 10,000 MIME parts and up to three levels of decoded nested messages. Those limits provide defined bounds for complex input, but applications with messages beyond them should account for the defaults. The project says every library function has been fuzzed and tested with MIRI, and that Stalwart Mail Server uses the library in production worldwide.

Pricing

mail-parser is free and open source, with the choice of MIT or Apache License 2.0. The repository gives two free plan labels: Open-source library at no cost, and mail-parser at no cost. No paid plan or usage limits are stated on the repository page. There is no free trial; the relevant cost is the engineering work of integrating a Rust library.

Platforms

The listed platforms are Linux, macOS and self-hosted. The minimum supported Rust version is 1.98, a material compatibility requirement for teams maintaining older Rust toolchains.

Who it's for

This is a strong fit for developers building Rust applications that need message structure, body extraction or attachment parsing without handing messages to a hosted service. It is less suitable for teams that need a graphical mail-processing workflow, a hosted API, or message composition as part of the same library.

Pros and cons

  • Pros: It returns MIME structure, text and HTML bodies, and attachments, with fallback conversion when one body format is absent.
  • Pros: Lazy decoding, reference-based strings and SIMD scanning on supported targets are designed to reduce unnecessary processing and memory copies.
  • Pros: MIT or Apache-2.0 licensing and no stated usage caps leave deployment and integration choices open.
  • Cons: Rust 1.98 is required, which rules it out for projects that cannot meet that toolchain floor.
  • Cons: It cannot create email messages, and optional capabilities require explicit feature selection.
  • Cons: Parser tolerance has a boundary: nonconforming input is only handled when it remains reasonably close to the standard.

Alternatives

For another self-hosted open-source library, PHP MIME Mail Parser is the more relevant choice when the application uses PHP 8.2 or later and can meet its mailparse extension requirement.

CloudMailin is worth considering when a hosted API or web service is preferable to embedding a parser: its free plan allows 10,000 emails per month, with a 512KB per-message limit and no card requirement, while its Starter plan is $25 a month for 10,000 emails per month and 2MB per message.

DigiParser is an API and web alternative with a free option; its paid plan starts at $14 a month for 100 payslips, with enterprise pricing for 1,000 or more documents per month.

Document Parser offers a web-based option with a free plan limited to one user and 20 documents; its Premium plan is $69.90 a month per user.

MailFrame is another API and web alternative. Its free plan provides 100 parse operations per month, one active schema, webhook delivery and community support, with no credit card required; its Indie plan is $19 a month.

MailParse offers a hosted API and web service, with a free plan for 100 emails per month, webhook delivery, REST polling, one inbound address and community support; its Pro plan is $29 a month for 10,000 emails per month.

noima is an API and web option whose free tier gives 10 documents once, with 30 days of retention; its Starter plan is €12 a month for 150 documents per month and 60 days of retention.

Parserr is another API and web alternative with a free plan for 15 emails and 10 documents per month, one inbox, unlimited parsing rules and integrations, and Zapier and Microsoft Flow support.

Browse Email Parsing Software for more options.

Verdict

Choose mail-parser when you need a Rust-native way to inspect email structure, bodies and attachments under a permissive open-source license. Its parsing focus, lazy decoding and bounded defaults make it a practical fit for application-level mail handling; choose another tool if you need hosted processing, broader workflow features or message creation.

Verdict

Choose mail-parser when a Rust application needs to read and extract content from email messages under an MIT or Apache-2.0 license. It includes attachment parsing and handles several message formats and encodings. Look elsewhere in the Stalwart project if you need to build messages; mail-parser does not provide that function.

Questions

Is Stalwart mail-parser free?

Yes. The open-source library is listed as free.

What license does it use?

It is available under either the MIT License or Apache License 2.0, at the user's option.

What does the library parse?

It parses email messages using Internet Message Format (RFC 5322), MIME (RFC 2045–2049), and other internet messaging RFCs. Its results include MIME structure, text and HTML bodies, and attachments.

Does mail-parser build email messages?

No. The library parses messages; the separate mail-builder crate is identified for message building.

Which Rust version does it require?

The minimum supported Rust version is 1.98.

Does it support legacy character sets?

It recognizes WHATWG encoding labels. Enabling the optional full_encoding feature adds legacy multibyte sets including Shift_JIS, Big5, and GB18030.

Facts from Stalwart mail-parser's own pages

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

Where Stalwart mail-parser stands on Freedom251

Look at these too