| Crates.io | envelope-addr |
| lib.rs | envelope-addr |
| version | 0.1.0 |
| created_at | 2025-12-31 21:37:03.3389+00 |
| updated_at | 2025-12-31 21:37:03.3389+00 |
| description | Minimal parsing and formatting for SMTP envelope addresses (non RFC 5322) |
| homepage | https://github.com/MatthewIsHere/envelope-addr-rs |
| repository | https://github.com/MatthewIsHere/envelope-addr-rs |
| max_upload_size | |
| id | 2015417 |
| size | 13,261 |
Minimal parsing and formatting for SMTP envelope addresses.
This crate handles only what SMTP actually uses in commands like MAIL FROM and RCPT TO.
It intentionally does not implement RFC 5322 header mailboxes.
Accepted forms:
local@domain<local@domain><> (null reverse-path, used for bounces)Behavior:
Name <user@domain>)If it wouldn’t appear in an SMTP command, it doesn’t belong here.
use envelope_addr::Addr;
let addr = Addr::parse_envelope(" <User@Example.COM> ")?;
assert_eq!(addr.local, "User");
assert_eq!(addr.domain, "example.com");
assert_eq!(addr.to_addr_spec(), "User@example.com");
assert_eq!(addr.to_bracketed(), "<User@example.com>");
Null reverse-path:
let null = Addr::parse_envelope("<>")?;
assert!(null.is_null());
Licensed under the MIT license