email_address 0.1.0

A Rust crate providing an implementation of an RFC-compliant `EmailAddress` newtype.
Documentation

Crate email_address

A Rust crate providing an implementation of an RFC-compliant EmailAddress newtype.

MIT License Minimum Rust Version crates.io docs.rs travis.ci GitHub stars

TBD

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

  1. RFC 3629: UTF-8, a transformation format of ISO 10646, IETF, Nov 2003.
  2. RFC 3696: Application Techniques for Checking and Transformation of Names, IETF, Feb 2004.
  3. RFC 5321: Simple Mail Transfer Protocol, IETF, Oct 2008.
  4. RFC 5322: Internet Message Format, I ETF, Oct 2008.
  5. RFC 5890: Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework, IETF, Aug 2010.
  6. RFC 6531: SMTP Extension for Internationalized Email, IETF, Feb 2012
  7. RFC 5234: Augmented BNF for Syntax Specifications: ABNF, IETF, Jan 2008.

Changes

Version 0.1.0

  • Basic type implementation and structure based on RFC 5322.
  • See TODO.

TODO

  1. Full Unicode support.
  2. Support comments.
  3. to_uri needs to support URI encoding.
  4. Support line-feed and whitespace rules.
  5. Does not parse into domain-literal values, only does surface syntax check.