Class: Truemail::Validate::Smtp
- Defined in:
- lib/truemail/validate/smtp.rb,
lib/truemail/validate/smtp/request.rb,
lib/truemail/validate/smtp/response.rb
Defined Under Namespace
Constant Summary collapse
- ERROR =
'smtp error'
- RESPONSE_ATTRS =
%i[port_opened connection helo mailfrom rcptto errors].freeze
Instance Attribute Summary collapse
-
#smtp_results ⇒ Object
readonly
Returns the value of attribute smtp_results.
Attributes inherited from Worker
Instance Method Summary collapse
-
#initialize(result) ⇒ Smtp
constructor
A new instance of Smtp.
- #run ⇒ Object
Methods inherited from Worker
Constructor Details
#initialize(result) ⇒ Smtp
Returns a new instance of Smtp.
10 11 12 13 |
# File 'lib/truemail/validate/smtp.rb', line 10 def initialize(result) super(result) @smtp_results = [] end |
Instance Attribute Details
#smtp_results ⇒ Object (readonly)
Returns the value of attribute smtp_results.
8 9 10 |
# File 'lib/truemail/validate/smtp.rb', line 8 def smtp_results @smtp_results end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/truemail/validate/smtp.rb', line 15 def run return false unless Truemail::Validate::MxBlacklist.check(result) establish_smtp_connection return true if success(success_response?) result.smtp_debug = smtp_results return true if success(not_includes_user_not_found_errors?) add_error(Truemail::Validate::Smtp::ERROR) false end |