README.md in truemail-1.5.0 vs README.md in truemail-1.5.1

- old
+ new

@@ -23,11 +23,11 @@ - [Blacklist case](#blacklist-case) - [Duplication case](#duplication-case) - [Regex validation](#regex-validation) - [With default regex pattern](#with-default-regex-pattern) - [With custom regex pattern](#with-custom-regex-pattern) - - [MX validation](#mx-validation) + - [DNS (MX) validation](#mx-validation) - [SMTP validation](#smtp-validation) - [SMTP safe check disabled](#smtp-safe-check-disabled) - [SMTP safe check enabled](#smtp-safe-check-enabled) - [Event logger](#event-logger) - [Available tracking events](#available-tracking-events) @@ -42,10 +42,11 @@ - [License](#license) - [Code of Conduct](#code-of-conduct) - [Credits](#credits) - [Versioning](#versioning) - [Changelog](CHANGELOG.md) +- [Wiki](https://github.com/rubygarage/truemail/wiki) ## Synopsis Email validation is a tricky thing. There are a number of different ways to validate an email address and all mechanisms must conform with the best practices and provide proper validation. You can get more information about email validation techniques in our [blog](https://rubygarage.org/blog/how-to-validate-emails). The Truemail gem helps you validate emails via regex pattern, presence of DNS records, and real existence of email account on a current email server. @@ -59,11 +60,11 @@ ## Features - Configurable validator, validate only what you need - Minimal runtime dependencies -- Supporting of internationalized emails (EAI) +- Supporting of internationalized emails ([EAI](https://en.wikipedia.org/wiki/Email_address#Internationalization)) - Whitelist/blacklist validation layers - Simple SMTP debugger - Event logger - JSON serializer @@ -549,11 +550,11 @@ @validation_type=:regex> ``` #### MX validation -Validation by MX records is the second validation level. It uses Regex validation before running itself. When regex validation has completed successfully then runs itself. +In fact it's DNS validation because it checks not MX records only. DNS validation is the second validation level, historically named as MX validation. It uses Regex validation before running itself. When regex validation has completed successfully then runs itself. ```code [Whitelist/Blacklist] -> [Regex validation] -> [MX validation] ``` @@ -946,9 +947,24 @@ config.before { allow(Truemail).to receive(:valid?).and_return(true) } # or config.before { allow(Truemail).to receive(:validate).and_return(true) } # or config.before { allow(Truemail).to receive_message_chain(:validate, :result, :valid?).and_return(true) } +end +``` + +Or with [whitelist/blacklist Truemail feature](#whitelistblacklist-check) you can define validation behavior for test and staging environment: + +```ruby +# config/initializers/truemail.rb + +Truemail.configure do |config| + config.verifier_email = Rails.configuration.default_sender_email + + unless Rails.env.production? + config.whitelisted_domains = Constants::Email::WHITE_DOMAINS + config.blacklisted_domains = Constants::Email::BLACK_DOMAINS + end end ``` --- ## Truemail family