v2.4.0: Feature/MxBlacklist validation layer
MX blacklist layer provides checking extracted mail server(s) IP address from MX validation with predefined blacklisted IP addresses list. It can be used as a part of DEA (disposable email address) validations.
[Whitelist/Blacklist] -> [Regex validation] -> [MX validation] -> [MX blacklist validation]
Example of usage:
require 'truemail'
Truemail.configure do |config|
config.verifier_email = '[email protected]'
config.blacklisted_mx_ip_addresses = ['127.0.1.2']
end
Truemail.validate('[email protected]', with: :mx_blacklist)
=> #<Truemail::Validator:0x00007fca0c8aea70
@result=
#<struct Truemail::Validator::Result
success=false,
email="[email protected]",
domain="example.com",
mail_servers=["127.0.1.1", "127.0.1.2"],
errors={:mx_blacklist=>"blacklisted mx server ip address"},
smtp_debug=nil,
configuration=
#<Truemail::Configuration:0x00007fca0c8aeb38
@blacklisted_domains=[],
@blacklisted_mx_ip_addresses=["127.0.1.2"],
@connection_attempts=2,
@connection_timeout=2,
@default_validation_type=:smtp,
@dns=[],
@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)/,
@not_rfc_mx_lookup_flow=false,
@response_timeout=2,
@smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
@smtp_fail_fast=false,
@smtp_safe_check=false,
@validation_type_by_domain={},
@verifier_domain="example.com",
@verifier_email="[email protected]",
@whitelist_validation=false,
@whitelisted_domains=[]>>,
@validation_type=:mx_blacklist>
- Added
Truemail::Validate::MxBlacklist
, tests - 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
- Updated gem version to
2.4.0