No release in over 3 years
Low commit activity in last 3 years
Basically based on RFC 5322, with some additional validations so it works on almost all variety of systems.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

Build Status

real_world_email_validator

Email address validator that real world needs, for ActiveModel 3+.

Validating email address is hard. Its format definition varies on all kinds of systems depending on its generation, thus, hard. This validator does the job based on RFC 5322, but not exactly. It does few additional validations to make sure the email address works well on almost all kinds of systems, regardless its generations.

Read more about this on wikipedia.

Requirements

  • Ruby 2.4+
  • ActiveModel 3+

Install

gem install real_world_email_validator

or if you use bundler:

bundle add real_world_email_validator

Usage

class MyCompany
  include ::ActiveModel::Model

  attr_accessor :email

  validates :email, real_world_email: true
end

my_company = MyCompany.new

my_company.email = 'foo@example.com'
my_company.valid?
=> true

my_company.email = 'fo o@example.com'
my_company.valid?
=> false