ruby-changes:16241
From: shyouhei <ko1@a...>
Date: Tue, 8 Jun 2010 15:15:09 +0900 (JST)
Subject: [ruby-changes:16241] Ruby:r28208 (ruby_1_8_7): merge revision(s) 27374,27512:
shyouhei 2010-06-08 15:14:59 +0900 (Tue, 08 Jun 2010) New Revision: 28208 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28208 Log: merge revision(s) 27374,27512: * lib/net/smtp.rb (Net::SMTP#rcptto_list): continue when at least one RCPT is accepted. based on a patch from Kero van Gelder at [ruby-core:26190]. * lib/net/smtp.rb (Net::SMTP#rcptto_list): fixed typo. [ruby-core:29809] Modified files: branches/ruby_1_8_7/ChangeLog branches/ruby_1_8_7/lib/net/smtp.rb branches/ruby_1_8_7/version.h Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 28207) +++ ruby_1_8_7/ChangeLog (revision 28208) @@ -1,3 +1,14 @@ +Tue Jun 8 15:15:18 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/net/smtp.rb (Net::SMTP#rcptto_list): fixed typo. + [ruby-core:29809] + +Tue Jun 8 15:15:18 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/net/smtp.rb (Net::SMTP#rcptto_list): continue when at least + one RCPT is accepted. based on a patch from Kero van Gelder at + [ruby-core:26190]. + Tue Jun 8 15:14:11 2010 Nobuyoshi Nakada <nobu@r...> * LEGAL: separated the section for parse.c. contributed by Paul Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 28207) +++ ruby_1_8_7/version.h (revision 28208) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2010-06-08" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20100608 -#define RUBY_PATCHLEVEL 272 +#define RUBY_PATCHLEVEL 273 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_7/lib/net/smtp.rb =================================================================== --- ruby_1_8_7/lib/net/smtp.rb (revision 28207) +++ ruby_1_8_7/lib/net/smtp.rb (revision 28208) @@ -651,8 +651,7 @@ def send_message(msgstr, from_addr, *to_addrs) raise IOError, 'closed session' unless @socket mailfrom from_addr - rcptto_list to_addrs - data msgstr + rcptto_list(to_addrs) {data msgstr} end alias send_mail send_message @@ -705,8 +704,7 @@ def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream raise IOError, 'closed session' unless @socket mailfrom from_addr - rcptto_list to_addrs - data(&block) + rcptto_list(to_addrs) {data(&block)} end alias ready open_message_stream # obsolete @@ -830,9 +828,23 @@ 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| - rcptto addr + begin + rcptto addr + rescue SMTPAuthenticationError + unknown_users << addr.dump + else + ok_users << addr + end end + raise ArgumentError, 'mail destination not given' if ok_users.empty? + ret = yield + unless unknown_users.empty? + raise SMTPAuthenticationError, "failed to deliver for #{unknown_users.join(', ')}" + end + ret end def rcptto(to_addr) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/