The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
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.
- Possibility 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
Available tracking events
: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
Email has whitelisted domain
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>
Email hasn't whitelisted domain
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
- Behaviour 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=
#<Net::SMTP::Response:0x0000000002c934c8
@status="250",
@string="250 mx1.example.com\n">,
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