Net::SMTP - invalid method raised when attempting to connect using STARTTLS
Simple attempt (in irb):
smtp = Net::SMTP.new('server', 587)
NoMethodError: undefined method
success?' for "200 dummy reply code":Stringcheck_response'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/irb:13:in `'
The problem is with the critical() method, the method returns the "dummy response" if there already was a pending error.
The fix is to replace the line of:
return '200 dummy reply code' if @error_occured
return Response.parse('200 dummy reply code') if @error_occured
Alternatively, one can have a "canned" dummy response instance, but that may be unnecessary considering this only happens in error path.
Updated by drbrain (Eric Hodel) over 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r43954.
Pawel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/net/smtp.rb (Net::SMTP#critical): Always return a Net::SMTP::Response. Patch by Pawel Veselov. [ruby-trunk - Bug #9125]
- test/net/smtp/test_smtp.rb: Test for the above.