Bug #3205: Problem with recent update to lib/net/smtp.rb rcptto_list method
http://redmine.ruby-lang.org/issues/show/3205

Author: Daniel Mavis
Status: Open, Priority: Normal
Category: lib
ruby -v: ruby 1.9.2dev (2010-04-19 trunk 27394)

Looks like recent update to lib/net/smtp.rb rcptto_list method uses unknown/undeclared variable name 'ok_addrs' instead of 'ok_users' which causes an exception when trying to send mail on line 842. See snippet below:

def rcptto_list(to_addrs)
  raise ArgumentError, 'mail destination not given' if to_addrs.empty?
  ok_users = []
  unknown_users = []
  to_addrs.flatten.each do |addr|
    begin
      rcptto addr
    rescue SMTPAuthenticationError
      unknown_users << addr.dump
    else
      ok_users << addr
    end
  end
  raise ArgumentError, 'mail destination not given' if ok_addrs.empty? #<= undeclared variable name 'ok_addrs', appears that it should be 'ok_users'
  ret = yield
  unless unknown_users.empty?
    raise SMTPAuthenticationError, "failed to deliver for #{unknown_users.join(', ')}"
  end
  ret
end


----------------------------------------
http://redmine.ruby-lang.org