{"id":47819067,"url":"https://github.com/structured-world/structured-email-address","last_synced_at":"2026-04-03T19:01:34.551Z","repository":{"id":346684625,"uuid":"1191100232","full_name":"structured-world/structured-email-address","owner":"structured-world","description":"RFC 5321/5322/6531 email address parser, validator, and normalizer for Rust. Subaddress extraction, provider-aware normalization, PSL domain validation, anti-homoglyph protection.","archived":false,"fork":false,"pushed_at":"2026-04-02T18:52:09.000Z","size":53,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T06:16:15.899Z","etag":null,"topics":["email","email-parser","email-validation","homoglyph","pure-rust","rfc-5321","rfc-5322","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/structured-world.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"structured-world"}},"created_at":"2026-03-24T23:17:53.000Z","updated_at":"2026-04-02T18:51:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/structured-world/structured-email-address","commit_stats":null,"previous_names":["structured-world/structured-email-address"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/structured-world/structured-email-address","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/structured-world%2Fstructured-email-address","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/structured-world%2Fstructured-email-address/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/structured-world%2Fstructured-email-address/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/structured-world%2Fstructured-email-address/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/structured-world","download_url":"https://codeload.github.com/structured-world/structured-email-address/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/structured-world%2Fstructured-email-address/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-parser","email-validation","homoglyph","pure-rust","rfc-5321","rfc-5322","rust"],"created_at":"2026-04-03T19:00:49.710Z","updated_at":"2026-04-03T19:01:34.543Z","avatar_url":"https://github.com/structured-world.png","language":"Rust","funding_links":["https://github.com/sponsors/structured-world"],"categories":[],"sub_categories":[],"readme":"# structured-email-address\n\nRFC 5321/5322/6531 conformant email address parser, validator, and normalizer for Rust.\n\n[![CI](https://github.com/structured-world/structured-email-address/actions/workflows/ci.yml/badge.svg)](https://github.com/structured-world/structured-email-address/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/structured-email-address.svg)](https://crates.io/crates/structured-email-address)\n[![docs.rs](https://docs.rs/structured-email-address/badge.svg)](https://docs.rs/structured-email-address)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n\n## What makes this different?\n\nEvery Rust email crate stops at RFC validation. This one goes further:\n\n| Feature | `email_address` | `email-address-parser` | **This crate** |\n|---------|:-:|:-:|:-:|\n| RFC 5322 grammar | Partial | Full | Full |\n| RFC 6531 (UTF-8) | Yes | Yes | Yes |\n| Subaddress/+tag extraction | - | - | **Yes** |\n| Provider-aware dot-stripping | - | - | **Yes** |\n| Configurable case folding | - | - | **Yes** |\n| PSL domain validation | - | - | **Yes** |\n| Anti-homoglyph detection | - | - | **Yes** |\n| IDN domain Unicode accessor | - | - | **Yes** |\n| Display name parsing | Yes | - | **Yes** |\n| Configurable strictness | Partial | Partial | **Full** |\n| Serde support | Yes | - | **Yes** |\n| Zero dependencies* | Yes | nom | `idna` + 3 |\n\n\\* Dependencies: `idna`, `unicode-normalization`, `unicode-security`. Optional: `psl`, `serde`.\n\n## Quick Start\n\n```rust\nuse structured_email_address::{EmailAddress, Config};\n\n// Parse with defaults (RFC 5322 Standard mode)\nlet email: EmailAddress = \"user+tag@example.com\".parse()?;\nassert_eq!(email.local_part(), \"user+tag\");\nassert_eq!(email.tag(), Some(\"tag\"));\nassert_eq!(email.domain(), \"example.com\");\n\n// International domains: IDNA roundtrip\nlet email: EmailAddress = \"user@münchen.de\".parse()?;\nassert_eq!(email.domain(), \"xn--mnchen-3ya.de\");\nassert_eq!(email.domain_unicode(), \"münchen.de\");\n```\n\n## Configured Parsing\n\n```rust\nuse structured_email_address::{EmailAddress, Config};\n\nlet config = Config::builder()\n    .strip_subaddress()          // user+tag → user\n    .dots_gmail_only()           // a.l.i.c.e@gmail.com → alice@gmail.com\n    .lowercase_all()             // USER → user\n    .check_confusables()         // detect Cyrillic lookalikes\n    .domain_check_psl()          // verify domain in Public Suffix List\n    .build();\n\nlet email = EmailAddress::parse_with(\"A.L.I.C.E+promo@Gmail.COM\", \u0026config)?;\nassert_eq!(email.canonical(), \"alice@gmail.com\");\nassert_eq!(email.tag(), Some(\"promo\"));\nassert!(email.is_freemail());\n```\n\n## Display Names\n\n```rust\nuse structured_email_address::{EmailAddress, Config};\n\nlet config = Config::builder().allow_display_name().build();\nlet email = EmailAddress::parse_with(\"John Doe \u003cuser@example.com\u003e\", \u0026config)?;\nassert_eq!(email.display_name(), Some(\"John Doe\"));\n```\n\n## Batch Parsing\n\nParse thousands of addresses in one call. Config is shared, results preserve input order:\n\n```rust\nuse structured_email_address::{EmailAddress, Config};\n\nlet config = Config::builder().strip_subaddress().lowercase_all().build();\nlet results = EmailAddress::parse_batch(\n    \u0026[\"alice@example.com\", \"invalid\", \"bob+tag@example.org\"],\n    \u0026config,\n);\nassert!(results[0].is_ok());\nassert!(results[1].is_err());\nassert!(results[2].is_ok());\n```\n\nFor large lists (10K+), enable the `rayon` feature for parallel parsing:\n\n```toml\nstructured-email-address = { version = \"0.0.1\", features = [\"rayon\"] }\n```\n\n```rust,ignore\nlet results = EmailAddress::parse_batch_par(\u0026huge_list, \u0026config);\n```\n\n### Batch Benchmarks (baseline)\n\n100K emails (mix of valid + invalid), `strip_subaddress` + `dots_gmail_only` + `lowercase_all` config.\nApple M1 Pro, Rust 1.85, `cargo bench --all-features`.\n\n| Variant | Time | Throughput |\n|---------|------|-----------|\n| `parse_batch` (sequential) | 49.1 ms | ~2.0M emails/sec |\n| `parse_batch_par` (rayon) | 9.6 ms | ~10.4M emails/sec |\n\nRayon gives ~5x speedup on this workload.\n\n## Strictness Levels\n\n| Level | Grammar | Use case |\n|-------|---------|----------|\n| `Strict` | RFC 5321 (envelope) | SMTP validation, reject exotic addresses |\n| `Standard` | RFC 5322 (header) | Default — full grammar, no obsolete forms |\n| `Lax` | RFC 5322 + obs-* | Legacy system interop |\n\n## Features\n\n| Feature | Default | Description |\n|---------|---------|-------------|\n| `serde` | Yes | Serialize/deserialize as canonical string |\n| `psl` | Yes | Domain validation against Public Suffix List |\n| `rayon` | No | Parallel batch parsing via `parse_batch_par()` |\n\n```toml\n# Minimal (no serde, no PSL)\nstructured-email-address = { version = \"0.0.1\", default-features = false }\n```\n\n## Anti-Homoglyph Protection\n\nDetects visually confusable email addresses using Unicode skeleton mapping:\n\n```rust\nuse structured_email_address::confusable_skeleton;\n\n// Cyrillic 'а' (U+0430) vs Latin 'a' (U+0061)\nassert_eq!(\n    confusable_skeleton(\"аlice\"),  // Cyrillic а\n    confusable_skeleton(\"alice\"),  // Latin a\n);\n```\n\n## Support the Project\n\n\u003cdiv align=\"center\"\u003e\n\n![USDT TRC-20 Donation QR Code](assets/usdt-qr.svg)\n\nUSDT (TRC-20): `TFDsezHa1cBkoeZT5q2T49Wp66K8t2DmdA`\n\n\u003c/div\u003e\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstructured-world%2Fstructured-email-address","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstructured-world%2Fstructured-email-address","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstructured-world%2Fstructured-email-address/lists"}