95899f6c42472e97abcb0a86c34ddb51c78dc412
The traits `Send + Sync` don't need to be implemented manually since
they get automatically implemented. To make sure this stays that way
a test was added.
This Commit also Removes a warning while generating the documentation.
```
warning: unresolved link to `RFC2234`
--> src/lib.rs:220:36
|
220 | > and is expressed in the ABNF of [RFC2234].
| ^^^^^^^ no item named `RFC2234` in scope
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
warning: `email_address` (lib doc) generated 1 warning
```
Crate email_address
A Rust crate providing an implementation of an RFC-compliant EmailAddress newtype.
Primarily for validation, the EmailAddress type is constructed with FromStr::from_str which will raise any
parsing errors. Prior to constructions the functions is_valid, is_valid_local_part, and is_valid_domain may
also be used to test for validity without constructing an instance.
Status
Currently, it supports all the RFC ASCII and UTF-8 character set rules as well as quoted and unquoted local parts but does not yet support all the productions required for SMTP headers; folding whitespace, comments, etc.
Example
use email_address::*;
assert!(EmailAddress::is_valid("user.name+tag+sorting@example.com"));
assert_eq!(
EmailAddress::from_str("Abc.example.com"),
Error::MissingSeparator.into()
);
Specifications
- RFC 1123: Requirements for Internet Hosts -- Application and Support, IETF,Oct 1989.
- RFC 3629: UTF-8, a transformation format of ISO 10646, IETF, Nov 2003.
- RFC 3696: Application Techniques for Checking and Transformation of Names, IETF, Feb 2004.
- RFC 4291 IP Version 6 Addressing Architecture, IETF, Feb 2006.
- RFC 5234: Augmented BNF for Syntax Specifications: ABNF, IETF, Jan 2008.
- RFC 5321: Simple Mail Transfer Protocol, IETF, Oct 2008.
- RFC 5322: Internet Message Format, I ETF, Oct 2008.
- RFC 5890: Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework, IETF, Aug 2010.
- RFC 6531: SMTP Extension for Internationalized Email, IETF, Feb 2012
- RFC 6532: Internationalized Email Headers, IETF, Feb 2012.
Changes
Version 0.2.1
- Added
From<EmailAddress>forString. - Added
AsRef<strforEmailAddress. - Added
local_partanddomainaccessors. - More unit tests, especially for the list above.
- Added more conditions to the warning and deny list.
- Fixed some Clippy warnings.
- Fixed a bug in encoding the mailto URI scheme.
Version 0.2.0
- Added UTF-8 support.
- Added more test cases, fixing defects in parsing.
- Method
to_urinow supports URI encoding the address as a part of the URI. - Added
is_valid_local_partandis_valid_domainmethods.
Version 0.1.0
- Basic type implementation and structure based on RFC 5322.
- See TODO.
TODO
- Support comments.
- Support line-feed and whitespace rules.
- Does not parse into
domain-literalvalues, only does surface syntax check.
Description
Languages
Rust
100%