CrystalEmail

forked from Nephos/CrystalEmail
A RFC compliant Email validator ✉️

Migrated to https://git.sceptique.eu/Sceptique/CrystalEmail

A RFC compliant Email validator

Prelude

Compliance

To do

  • To do : rfc 6530.
  • To do : Implement IPv6

Notes

  • No ipv6 for now
  • No escaped characters
  • Public email validity (no raw ip, domain withour root domain, ...)

Installation

Works with crystal 0.17 - 0.27.0

Add this to your application's shard.yml:

dependencies:
  CrystalEmail:
      github: place-labs/CrystalEmail

## Usage in Crystal

require "CrystalEmail"

# Pure Rfc5322
CrystalEmail::Rfc5322.validates? "toto@tata" # => true
CrystalEmail::Rfc5322.match "toto@tata" # => #<MatchData "toto@tata" local:"toto" domain:"tata">
CrystalEmail::Rfc5322.validates? "toto" # => false
CrystalEmail::Rfc5322.match "toto" # => nil

# Rfc5322 + Internet basic usage
CrystalEmail::Rfc5322::Public.validates? "toto@tata.com" # => true
CrystalEmail::Rfc5322::Public.match "toto@tata.com" # => #<MatchData "toto@tata" local:"toto" domain:"tata.com">

"toto@toto.toto".is_email? # => true

Contributes !

Find a bug ? Want a new feature ? Create a clear pull request and we'll see :)

  • Nephos (poulet_a)
Repository

CrystalEmail

Owner
Statistic
  • 0
  • 0
  • 0
  • 2
  • 0
  • over 3 years ago
  • November 20, 2020
License

Do What The F*ck You Want To Public License

Links
Synced at

Wed, 20 Nov 2024 18:02:40 GMT

Languages