From: "hsbt (Hiroshi SHIBATA)" Date: 2013-11-29T19:06:39+09:00 Subject: [ruby-core:58681] [ruby-trunk - Bug #9125] Net::SMTP - invalid method raised when attempting to connect using STARTTLS Issue #9125 has been updated by hsbt (Hiroshi SHIBATA). Assignee set to drbrain (Eric Hodel) Could you review this? ---------------------------------------- Bug #9125: Net::SMTP - invalid method raised when attempting to connect using STARTTLS https://bugs.ruby-lang.org/issues/9125#change-43248 Author: pveselov (Pawel Veselov) Status: Open Priority: Normal Assignee: drbrain (Eric Hodel) Category: lib Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN Simple attempt (in irb): require 'net/smtp' smtp = Net::SMTP.new('server', 587) mtp.enable_starttls() smtp.start() NoMethodError: undefined method `success?' for "200 dummy reply code":String from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/smtp.rb:949:in `check_response' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/smtp.rb:554:in `do_start' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/smtp.rb:525:in `start' from (irb):9 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 to 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. -- http://bugs.ruby-lang.org/