Class: Truemail::Validate::Smtp::Request::Session
- Inherits:
-
Object
- Object
- Truemail::Validate::Smtp::Request::Session
- Defined in:
- lib/truemail/validate/smtp/request.rb
Constant Summary collapse
- UNDEFINED_VERSION =
'0.0.0'
Instance Method Summary collapse
-
#initialize(host, port, connection_timeout, response_timeout, net_class = ::Net::SMTP) ⇒ Session
constructor
A new instance of Session.
- #start(helo_domain, &block) ⇒ Object
Constructor Details
#initialize(host, port, connection_timeout, response_timeout, net_class = ::Net::SMTP) ⇒ Session
Returns a new instance of Session.
59 60 61 62 63 64 65 66 |
# File 'lib/truemail/validate/smtp/request.rb', line 59 def initialize(host, port, connection_timeout, response_timeout, net_class = ::Net::SMTP) @net_class = net_class @net_smtp_version = resolve_net_smtp_version @net_smtp = (old_net_smtp? ? net_class.new(host, port) : net_class.new(host, port, tls_verify: false)).tap do |settings| settings.open_timeout = connection_timeout settings.read_timeout = response_timeout end end |
Instance Method Details
#start(helo_domain, &block) ⇒ Object
68 69 70 71 72 |
# File 'lib/truemail/validate/smtp/request.rb', line 68 def start(helo_domain, &block) return net_smtp.start(helo_domain, &block) if net_smtp_version < '0.2.0' return net_smtp.start(helo_domain, tls_verify: false, &block) if old_net_smtp? net_smtp.start(helo: helo_domain, &block) end |