htmlmail

Crates.iohtmlmail
lib.rshtmlmail
version0.1.0
created_at2025-10-28 23:06:13.107967+00
updated_at2025-10-28 23:06:13.107967+00
descriptionPractical, fast, and correct email validator
homepage
repositoryhttps://codeberg.org/aumetra/htmlmail
max_upload_size
id1905751
size38,286
Aumetra Weisman (aumetra)

documentation

README

htmlmail

Fast, readable, correct. Choose three.

Validates email addresses according to the WHATWG HTML specification.
It also enforces some practical size limits SMTP imposes (because what good is an email you can't address?).

Why another validator? Regexes are so easy!

Good question! This started off as an experiment. I wanted to implement a simple parser using winnow that is readable and correct. Performance wasn't even a consideration when I started out. It just happened. A happy little accident.

I then started writing out some basic benchmarks and noticed that we are faster than fast_chemail in pretty much every bench. At least on my machine.

So I thought "hey, this is worth publishing. It's fast, readable, and correct. And really small so people can just audit it themselves!".

Features

  • Readable: The internals are all written from composable components using winnow. No unreadable regexes or handrolled parsers.
  • Fast: In our benchmarks we outperform fast_chemail
  • Correct: We adapted the test suite of fast_chemail and added a few more weird cases to ensure correctness.

Note: The test suite isn't ported 1:1 since fast_chemail actually rejects some emails that are actually allowed by the WHATWG standard.

We also run property tests against the official regex published by the WHATWG. This should ensure additional correctness.

License

This code is licensed under the MIT or Apache-2.0 license, at your choice.

Commit count: 0

cargo fmt