The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Updated runtime/development dependencies
- Updated
codeclimate
/reek
configs - Updated gem version
- Added ability to use custom logger instance in event logger. Thanks @n-rodriguez for report
- Added
Truemail::Logger::Builder
, tests
- Updated
Truemail::Configuration#logger=
, tests - Updated
Truemail::Logger
, tests - Updated
circleci
/lefthook
configs - Updated gem version
- Removed
Truemail::Configuration#logger_options
- Added ability to use custom logger in event logger
- Added
commitspell
linter
- Updated
Truemail::Configuration
- Updated
Truemail::Logger
- Updated development dependencies
- Updated
circleci
/lefthook
configs - Updated gem version
- Added supporting of latest Ruby 3.3.0
- Added
changelog
linter
- Updated development dependencies
- Updated
circleci
/rspec
/codeclimate
configs - Updated gem version
- Updated
valid?
predicate. Thanks @SofiaSousa for report - Updated runtime/development dependencies
- Updated
codeclimate
config - Updated gem version
- Updated runtime/development dependencies
- Updated gemspecs
- Updated RSpec helpers namespaces
- Updated
codeclimate
/reek
configs - Updated gem version
- Fixed
Truemail::RegexConstant::REGEX_DOMAIN
. Thanks @Sybe for report
- Updated
Truemail::Validate::Mx#hosts_from_cname_records?
- Updated
Truemail::Validate::Smtp#not_includes_user_not_found_errors?
- Updated development dependencies
- Updated gemspecs
- Updated
codeclimate
config - Updated gem version
- Updated development dependencies
- Updated gemspecs
- Updated
codeclimate
config - Updated gem version
- Updated development dependencies
- Updated gemspecs
- Updated
codeclimate
config - Updated gem version
- Updated development dependencies
- Updated gemspecs
- Updated
rubocop
/codeclimate
/circleci
configs - Updated gem version
- Added supporting of latest Ruby 3.2.0
- Added
changelog
linter
- Updated development dependencies
- Updated gemspecs
- Updated
CI
release script - Updated
rubocop
/codeclimate
/lefthook
/circleci
configs - Updated gem version
- Fixed linters issues
- Added
cspell
linter - Added
markdownlint
linter - Added
shellcheck
linter
- Updated gemspecs
- Updated
rubocop
/codeclimate
/lefthook
/circleci
configs - Updated gem version
mdl
linter, config
- Added new bunch of project linters
- Added auto deploy to RubyGems
- Added auto creating release notes on GitHub
- Updated gemspecs
- Updated
codeclimate
/circleci
configs - Updated gem development dependencies
- Updated gem version
- Removed
overcommit
dependency
- Updated gem runtime/development dependencies
- Updated gemspecs,
circleci
config - Updated
rubocop
/codeclimate
configs - Updated gem version
- Fixed wrong semantic version comparison in gemspec runtime dependency definition
- Updated RSpec helpers
- Updated gemspecs,
circleci
config - Updated gem version
- Added ability to specify whitelisted/blacklisted emails by complete match
Truemail.configure do |config|
# Optional parameter. Validation of email which contains whitelisted emails always will
# return true. Other validations will not processed even if it was defined in validation_type_for
# It is equal to empty array by default.
config.whitelisted_emails = %w[user@somedomain1.com user@somedomain2.com]
# Optional parameter. Validation of email which contains blacklisted emails always will
# return false. Other validations will not processed even if it was defined in validation_type_for
# It is equal to empty array by default.
config.blacklisted_emails = %w[user@somedomain3.com user@somedomain4.com]
end
- Updated
Truemail::Configuration
, tests - Updated namespace from
Truemail::Validate::DomainListMatch
toTruemail::Validate::ListMatch
- Updated `Truemail::Validator#run, tests
- Updated
Truemail::Log::Serializer::ValidatorJson
, tests - Updated
Truemail::Log::Serializer::ValidatorText
, tests - Updated
Truemail::Log::Serializer::AuditorJson
, tests - Updated schemas, gemspecs,
circleci
/codeclimate
config - Updated docs, gem version
- Updated gemspecs,
circleci
config - Updated
codeclimate
config - Updated gem version
- Updated gemspecs,
circleci
config - Updated
rubocop
/codeclimate
configs - Updated gem version
- Updated gemspecs,
circleci
config - Updated
rubocop
/codeclimate
configs - Updated gem version
- Updated gemspecs,
circleci
config - Updated
rubocop
/codeclimate
configs - Updated git templates
- Updated gem version
- Updated truemail gemspecs
- Updated gem version
- Added ability to specify SMTP port number
- Updated truemail gemspec
- Updated gem version
- Added development environment guide docs
- Updated truemail gemspec
- Updated gem version
- Added gemspec with latest dependencies for latest Ruby env
- Updated default gemspec, ruby-version
- Updated
circleci
Ruby env flow - Updated gem version
- Fixed redefining builtin implementations caused using stdlib as external dependencies
- Fixed redefining builtin implementations caused using stdlib as external dependencies. Thanks @adzap for report.
- Updated gem
net-smtp
runtime dependency - Updated gem development dependencies
- Updated gem version
- Updated tests
- Updated gem development dependencies
- Updated gem version
- Fixed redefining builtin implementations caused using stdlib as external dependencies. Thanks @allard for report.
- Updated
Truemail::Validate::Smtp::Request::Session#initialize
,Truemail::Validate::Smtp::Request::Session#start
, tests - Updated
rubocop
/reek configs - Updated gem docs, version
- Added Ruby 3.1.x compatibility
- Added
Truemail::Validate::Smtp::Request::Session
-Net::SMTP
wrapper, tests
- Updated
Truemail::Validate::Smtp::Request#session
,Truemail::Validate::Smtp::Request#run
, tests - Updated
rubocop
/reek/codeclimate
/circleci
configs - Updated gem runtime/development dependencies
- Updated gem docs, version
Net::SMTP#start
Ruby 2.x compatibility. Thanks @evserykh for bug report.
- Updated
Truemail::Validate::Smtp::Request#run
- Updated
rubocop
/codeclimate
configs - Updated gem development dependencies
- Updated gem docs, version
- Fixed Ruby 3.0 stdlib SMTP client SSL certificate verification issues for cases when IP address uses as MX host. Thanks @esb for bug report.
- Updated
Truemail::Validate::Smtp::Request#run
- Updated gem development dependencies
- Updated gem version
Truemail::RegexConstant::REGEX_EMAIL_PATTERN
behavior with double@
in email. Thanks @your-favorite-dev for bug report.
- Updated tests
- Updated gem development dependencies
- Updated gem version
- Updated gem development dependencies
- Updated gem version
Optimized DNS (MX) validation flow. Removed needless DNS request for case when custom email pattern was defined and email for validation includes invalid domain name.
- Updated
Truemail::Validate::Mx#run
, tests - Updated gem development dependencies
- Updated gem documentation, version
- Updated
Truemail::Validate::DomainListMatch#email_domain
, tests - Updated
Truemail::Validate::Mx#domain
, tests - Updated gem development dependencies
- Updated gem version
- Updated gem development dependencies
- Updated gem version
faker
toffaker
development dependency
- Updated gem codebase, refactored
Truemail::RspecHelper::Context
- Updated tests with
Truemail::RspecHelper::Dns#dns_mock_gateway
- Updated gem development dependencies
- Updated gem version
- Wrong domain punycode extraction in DNS validation layer
- Updated gem codebase, restored
Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL
- Updated tests
Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL
Truemail::Validate::Mx
- Updated gem development dependencies
- Updated gem version
Allowed using special characters in email user names (following RFC 3696) for default regex email pattern.
- Updated
Truemail::RegexConstant::REGEX_EMAIL_PATTERN
, tests - Updated gem development dependencies
- Updated
rubocop
/codeclimate
config - Updated gem documentation, version
- Updated gem development dependencies
- Updated
rubocop
/codeclimate
config - Updated gem documentation, version
- Fixed security vulnerability for bundler (CVE-2019-3881)
- Fixed test coverage issues
- Updated gem development dependencies
- Updated
simplecov
/circleci
config - Updated gem documentation, version
Truemail::Validate::MxBlacklist
, tests- Updated gem development dependencies
- Updated gem documentation, version
- Implemented
MxBlacklist
validation. This layer provides checking mail servers with predefined blacklisted IP addresses list and can be used as a part of DEA (disposable email address) validations.
Truemail.configure do |config|
# Optional parameter. With this option Truemail will filter out unwanted mx servers via
# predefined list of ip addresses. It can be used as a part of DEA (disposable email
# address) validations. It is equal to empty array by default.
config.blacklisted_mx_ip_addresses = ['1.1.1.1', '2.2.2.2']
end
- Updated
Truemail::Core
, tests - Updated
Truemail::Configuration
, tests - Updated
Truemail::Validator
- Updated
Truemail::Validate::Smtp
, tests - Updated
Truemail::Log::Serializer::Base
, dependent tests - Updated
Truemail::Log::Serializer::ValidatorText
, tests - Updated gem development dependencies
- Updated gem documentation, changelog, version
Fixed bug with impossibility to use valid dns port number. Now validation for dns port for range 1..65535
works as expected.
- Updated
Truemail::RegexConstant::REGEX_PORT_NUMBER
, tests - Updated gem documentation
circleci
config moved to.
circleci/config.yml
- Updated gem development dependencies
- Updated
rubocop
/codeclimate
config - Updated
circleci
config
- Updated gem development dependencies
- Updated
rubocop
/codeclimate
config
- Updated gem development dependencies
- Updated
rubocop
/codeclimate
config - Updated tests
- Ability to use custom DNS gateway. Thanks @le0pard for the great idea and @verdi8 for feature request.
Truemail.configure do |config|
# Optional parameter. This option will provide to use custom DNS gateway when Truemail
# interacts with DNS. If you won't specify nameserver's ports Truemail will use default
# DNS TCP/UDP port 53. By default Truemail uses DNS gateway from system settings
# and this option is equal to empty array.
config.dns = ['10.0.0.1', '10.0.0.2:5300']
end
- Added
Truemail::Dns::Resolver
- Added
Truemail::Dns::Worker
- Updated
Truemail::Configuration
, tests - Updated
Truemail::Validate::Mx
, tests - Updated
Truemail::Audit::Base
- Updated
Truemail::Audit::Dns
, tests - Updated
Truemail::Audit::Ptr
, tests - Updated
Truemail::Log::Serializer::Base
, dependent tests - Updated namespaces for stdlib classes
- Updated gem development dependencies
- Updated linters/
codeclimate
configs - Updated gem runtime/development dependencies
- Updated gem documentation, changelog, version
Removed needless Timeout.timeout
block in Truemail::Validate::Smtp::Request#check_port
, replaced TCPSocket
to Socket
with native timeout detection. Thanks to @wikiti for idea, testing on production and clean PR #127.
- Updated
Truemail::Validate::Smtp::Request
- Updated gem development dependencies
- Updated
rubocop
, reek configs
- Updated gem development dependencies
- Updated
rubocop
config
- Filter out ASCII-8BIT chars for serialized SMTP response errors. Fixed
Encoding::UndefinedConversionError
inTruemail::Log::Serializer::ValidatorJson#serialize
. Thanks to @eni9889 for report - Added missed
smtp_fail_fast
attribute to serialized validator and auditor results
- Added
Truemail::Log::Serializer::ValidatorBase#replace_invalid_chars
- Updated
Truemail::Log::Serializer::Base
- Updated
Truemail::Log::Serializer::ValidatorBase
- Updated gem development dependencies
Ability to use fail fast behavior for SMTP validation layer. When smtp_fail_fast = true
it means that truemail
ends smtp validation session after first attempt on the first mx server in any fail cases (network connection/timeout error, smtp validation error). This feature helps to reduce total time of SMTP validation session up to 1 second.
- Added
Truemail::Configuration#smtp_fail_fast
- Added
Truemail::Validate::Smtp#smtp_fail_fast?
- Added
Truemail::Validate::Smtp#filtered_mail_servers_by_fail_fast_scenario
- Updated
Truemail::Validate::Smtp#attempts
- Updated
Truemail::Validate::Smtp#establish_smtp_connection
- Updated gem documentation
It's a configurable and not required option:
Truemail.configure do |config|
config.smtp_fail_fast = true # by default it's equal to false
end
Thanks to @wikiti for timeout reports.
Collecting only unique ip-addresses for target mail servers. This update reduces email validation time for case when remote server have closed connection via avoiding connection attempt to server with the same ip address.
- Updated
Truemail::Validate::Mx#fetch_target_hosts
Timeouts time units in Setting global configuration
of Truemail documentation's section. Thanks to @wikiti for report.
- Refactored
Truemail::RegexConstant::REGEX_EMAIL_PATTERN
- Updated gem development dependencies
- Updated gem documentation
- Updated gem development dependencies
- Updated gem documentation
SMTP connection errors: invalid HELO
hostname (localhost
), duplicate HELO
(verifier domain
). Thanks to @nenoganchev for report.
- Updated
Truemail::Validate::Smtp::Request#run
- Updated
Truemail::Validate::Smtp::Request#session_data
- Updated
Truemail::Validate::Smtp::Response
Now helo
is a Boolean
instead of Net::SMTP::Response
instance. It was changed because helo
is sending during SMTP-session initializing (Net::SMTP.new.start
), and helo
is always true
if session up is okay. Also hello
response won't logged as error if it happens. Example of Truemail::Validate::Smtp::Response
instance from 2.x version.
#<struct Truemail::Validate::Smtp::Response:0x00007fa74704cd10
port_opened=true,
connection=true,
helo=true, # Returns Boolean instead of Net::SMTP::Response instance
mailfrom=false,
rcptto=nil,
errors={:mailfrom=>"server response timeout"}>
Truemail::TypeError
- error handling for invalid types as input email
- Updated
Truemail.validate
- Updated
Truemail.valid?
Migrated to updated Ruby 2.7.x syntax.
- Updated
Truemail::Configuration#logger=
- Ability to use
Truemail::Auditor
instance represented as json directly Truemail::Log::Serializer::AuditorJson
Truemail::Auditor
,Truemail::Validator
- serializers namespaces
- gem development dependencies
- gem documentation
Truemail.host_audit.as_json
=>
# Serialized Truemail::Auditor instance
{
"date": "2020-08-31 22:33:43 +0300",
"current_host_ip": "127.0.0.1",
"warnings": {
"dns": "A-record of verifier domain not refers to current host ip address", "ptr": "PTR-record does not reference to current verifier domain"
},
"configuration": {
"validation_type_by_domain": null,
"whitelist_validation": false,
"whitelisted_domains": null,
"blacklisted_domains": null,
"not_rfc_mx_lookup_flow": false,
"smtp_safe_check": false,
"email_pattern": "default gem value",
"smtp_error_body_pattern": "default gem value"
}
}
Separated audit features for verifier host.
Truemail::Audit::Ip
Truemail::Audit::Dns
Truemail.host_audit
=> #<Truemail::Auditor:0x00005580df358828
@result=
#<struct Truemail::Auditor::Result
current_host_ip="127.0.0.1",
warnings={
:dns=>"a record of verifier domain not refers to current host ip address",
:ptr=>"ptr record does not reference to current verifier domain"
},
configuration=
#<Truemail::Configuration:0x00005615e86327a8
@blacklisted_domains=[],
@connection_attempts=2,
@connection_timeout=2,
@default_validation_type=:smtp,
@email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
@response_timeout=2,
@smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
@not_rfc_mx_lookup_flow=false,
@smtp_safe_check=false,
@validation_type_by_domain={},
@verifier_domain="example.com",
@verifier_email="verifier@example.com",
@whitelist_validation=false,
@whitelisted_domains=[]>
Truemail::Auditor
Truemail::Auditor::Result
Truemail::Audit::Base
Truemail::Audit::Ptr
Truemail::VERSION
- gem documentation
- Ability to show
not_rfc_mx_lookup_flow
attribute in serialized validation result
Truemail.validate('nonexistent_email@bestweb.com.ua').as_json
=>
# Serialized Truemail::Validator instance
{
"date": "2020-05-10 10:00:00 +0200",
"email": "nonexistent_email@bestweb.com.ua",
"validation_type": "smtp",
"success": false,
"errors": {
"smtp": "smtp error"
},
"smtp_debug": [
{
"mail_host": "213.180.193.89",
"port_opened": true,
"connection": true,
"errors": {
"rcptto": "550 5.7.1 No such user!\n"
}
}
],
"configuration": {
"validation_type_by_domain": null,
"whitelist_validation": false,
"whitelisted_domains": null,
"blacklisted_domains": null,
"not_rfc_mx_lookup_flow": false,
"smtp_safe_check": false,
"email_pattern": "default gem value",
"smtp_error_body_pattern": "default gem value"
}
}
Truemail::Log::Serializer::Base
Truemail::VERSION
- gem documentation
- Ability to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
Truemail.configure do |config|
# Optional parameter. This option will provide to use not RFC MX lookup flow.
# It means that MX and Null MX records will be cheked on the DNS validation layer only.
# By default this option is disabled.
config.not_rfc_mx_lookup_flow = true
end
Truemail.configuration
Truemail::Validate::Mx
Truemail::VERSION
- gem development dependencies
- gem documentation
Truemail.configuration
Truemail::ArgumentError
Truemail::Audit::Ptr
Truemail::VERSION
- gem development dependencies
- gem documentation
Truemail::Configuration.retry_count
deprecated, and alias for this method has been removed. Please use Truemail::Configuration.connection_attempts
instead.
- Ability to use
Truemail::Validator
instance represented as json directly
- gem development dependencies
- gem documentation
- gem development dependencies
- gem documentation
- Supporting of internationalized emails (EAI). Now you can validate emails, like:
dörte@sörensen.de
,квіточка@пошта.укр
,alegría@mañana.es
Truemail::RegexConstant::REGEX_DOMAIN
Truemail::RegexConstant::REGEX_EMAIL_PATTERN
Truemail::Validator::Result
Truemail::Validate::Mx#run
Truemail::Validate::Smtp#establish_smtp_connection
- gem runtime dependencies
- gem development dependencies
- gem documentation
- linters configs
Truemail::Configuration
- gem development dependencies
- linters configs
- gem development dependencies
- gem documentation
- linters configs
- truemail rspec helpers (moved to independent gem
truemail-rspec
)
- Event logger (ability to output validation logs to stdout/file)
- JSON serializer for validator instance
- Changelog
- Logo
Truemail gem allows to output tracking events to stdout/file or both of these. Please note, at least one of the outputs must exist. Tracking event by default is :error
:all
, all detected events including success validation cases:unrecognized_error
, unrecognized errors only (whensmtp_safe_check = true
and SMTP server does not return an exact answer that the email does not exist):recognized_error
, recognized errors only:error
, recognized and unrecognized errors only
Truemail.configure do |config|
config.logger = { tracking_event: :all, stdout: true, log_absolute_path: '/home/app/log/truemail.log' }
end
Also starting from this version Truemail has built in JSON serializer for Truemail::Validator
instance, so you can represent your email validation result as json.
Truemail::Log::Serializer::Json.call(Truemail.validate('nonexistent_email@bestweb.com.ua'))
Truemail::Configuration
Truemail::Validator
Truemail::Validate::Regex
Truemail::VERSION
- gem documentation
- gem description
- Ability to create new
Truemail::Configuration
instance with block Truemail::Validate::Smtp::Request::Configuration
Truemail::Wrapper
Truemail::Validate::Base
Truemail::Validator
Truemail::Validator::Result
Truemail::Validate::Regex
Truemail::Validate::Mx
Truemail::Validate::Smtp
Truemail::Validate::Smtp::Request
Truemail::Audit::Base
Truemail::Auditor
Truemail::Audit::Ptr
::Truemail
moduleTruemail::VERSION
- gem documentation
- gem description
- Removed memoization from
DomainListMatch#whitelisted_domain?
Truemail::VERSION
- gem documentation
- Configurable option: validation for whitelisted domains only.
When email domain in whitelist and whitelist_validation
is sets equal to true
validation type will be passed to other validators. Validation of email which not contains whitelisted domain always will return false
.
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
config.whitelisted_domains = ['white-domain.com']
config.whitelist_validation = true
end
Truemail.validate('email@white-domain.com', with: :regex)
#<Truemail::Validator:0x000055b8429f3490
@result=#<struct Truemail::Validator::Result
success=true,
email="email@white-domain.com",
domain=nil,
mail_servers=[],
errors={},
smtp_debug=nil>,
@validation_type=:regex>
Truemail.validate('email@domain.com', with: :regex)
#<Truemail::Validator:0x000055b8429f3490
@result=#<struct Truemail::Validator::Result
success=false,
email="email@domain.com",
domain=nil,
mail_servers=[],
errors={},
smtp_debug=nil>,
@validation_type=:blacklist>
Truemail::VERSION
- gem documentation
- Configurable default validation type, issue details
You can predefine default validation type for Truemail.validate('email@email.com')
call without with-parameter. Available validation types: :regex
, :mx
, :smtp
. By default validation type still remains :smtp
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
config.default_validation_type = :mx
end
Truemail::VERSION
- gem documentation
- Result validation type marker for domain list match check
Truemail.validate('email@white-domain.com')
#<Truemail::Validator:0x000055b8429f3490
@result=#<struct Truemail::Validator::Result
success=true,
email="email@white-domain.com",
domain=nil,
mail_servers=[],
errors={},
smtp_debug=nil>,
@validation_type=:whitelist>
Truemail.validate('email@black-domain.com')
#<Truemail::Validator:0x000023y8429f3493
@result=#<struct Truemail::Validator::Result
success=false,
email="email@black-domain.com",
domain=nil,
mail_servers=[],
errors={},
smtp_debug=nil>,
@validation_type=:blacklist>
Truemail::VERSION
- gem documentation
- Feature domain whitelist blacklist. Other validations will not processed even if it was defined in
validation_type_for
.
Truemail.configure do |config|
# Optional parameter. Validation of email which contains whitelisted domain
# always will return true.
config.whitelisted_domains = ['somedomain1.com', 'somedomain2.com']
# Optional parameter. Validation of email which contains whitelisted domain
# always will return false.
config.blacklisted_domains = ['somedomain1.com', 'somedomain2.com']
end
and
Truemail.configuration.whitelisted_domains = ['somedomain1.com', 'somedomain2.com']
Truemail.configuration.blacklisted_domains = ['somedomain1.com', 'somedomain2.com']
:skip
validation type forvalidation_type_for
- error key in
lower_snake_case
Truemail::VERSION
- gem documentation
- skip validation by domain for
validation_type_for
configuration option:
Truemail.configure do |config|
config.validation_type_for = { 'somedomain.com' => :skip }
end
and
Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
Truemail::VERSION
- gem documentation
- SMTP error body configurable option, issue details
Truemail::VERSION
- gem documentation
- Empty ptr constant
- Reverse trace, issue details
- Behavior of current host address resolver, issue details
Truemail::VERSION
- gem documentation
- PTR record audit, issue details
Truemail::VERSION
- gem documentation
- MX gem logic with RFC 7505, null MX record supporting, issue details
- Contributing guideline
- Multihomed MX records supporting, issue details
Truemail::VERSION
- gem documentation
- Retries for
Truemail::Validate::Smtp
for cases when one mx server
Truemail::Configuration
class, please use.connection_attempts
instead.retry_count
Truemail::VERSION
- gem documentation
- Checking A record presence if
MX
andCNAME
records not exist, issue details - Handling of
CNAME
records, issue details - Checking A record if
MX
andCNAME
records not found, issue details - Supporting of multihomed MX records, conversion host names to ips, issue details
- Timeout configuration for DNS resolver, issue details
.valid?
helper
Truemail::VERSION
- gem documentation
- Independent domain name extractor to
Truemail::Validate::Mx#run
- Default
REGEX_EMAIL_PATTERN
, issue details- local part of address can't start with a dot or special symbol
- local part of address can include
+
symbol
- Default
REGEX_DOMAIN_PATTERN
, issue details- TLD size increased up to 63 characters
- Case sensitive domain names, issue details
Truemail::VERSION
- gem documentation
- 'SMTP safe check' option for cases when SMTP server does not return an exact answer that the email does not exist.
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
config.smtp_safe_check = true
end
Truemail.validate('email@example.com')
# Successful SMTP validation
=> #<Truemail::Validator:0x0000000002ca2c70
@result=
#<struct Truemail::Validator::Result
success=true,
email="email@example.com",
domain="example.com",
mail_servers=["mx1.example.com"],
errors={},
smtp_debug=
[#<Truemail::Validate::Smtp::Request:0x0000000002c95d40
@configuration=
#<Truemail::Configuration:0x0000000002c95b38
@connection_timeout=2,
@email_pattern=/regex_pattern/,
@response_timeout=2,
@smtp_safe_check=true,
@validation_type_by_domain={},
@verifier_domain="example.com",
@verifier_email="verifier@example.com">,
@email="email@example.com",
@host="mx1.example.com",
@response=
#<struct Truemail::Validate::Smtp::Response
port_opened=true,
connection=false,
helo=true,
mailfrom=false,
rcptto=nil,
errors={:mailfrom=>"554 5.7.1 Client host blocked\n", :connection=>"server dropped connection after response"}>>,]>,
@validation_type=:smtp>
Truemail::VERSION
- gem documentation