ruby-changes:34536
From: nagachika <ko1@a...>
Date: Mon, 30 Jun 2014 03:01:34 +0900 (JST)
Subject: [ruby-changes:34536] nagachika:r46617 (ruby_2_1): merge revision(s) r46331: [Backport #9885]
nagachika 2014-06-30 03:01:18 +0900 (Mon, 30 Jun 2014) New Revision: 46617 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46617 Log: merge revision(s) r46331: [Backport #9885] * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body type as "MIXED" followed immediately by params [ruby-core:62864] [Bug #9885] Patch by @rayners (David Raynes). [Fixes GH-622] https://github.com/ruby/ruby/pull/622 Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/lib/net/imap.rb branches/ruby_2_1/test/net/imap/test_imap_response_parser.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46616) +++ ruby_2_1/ChangeLog (revision 46617) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Mon Jun 30 02:59:08 2014 Shugo Maeda <shugo@r...> + + * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body + type as "MIXED" followed immediately by params + [ruby-core:62864] [Bug #9885] + Patch by @rayners (David Raynes). [Fixes GH-622] + https://github.com/ruby/ruby/pull/622 + Mon Jun 30 02:46:44 2014 Rei Odaira <Rei.Odaira@g...> * signal.c (ruby_signal): should return either `old.sa_sigaction` Index: ruby_2_1/lib/net/imap.rb =================================================================== --- ruby_2_1/lib/net/imap.rb (revision 46616) +++ ruby_2_1/lib/net/imap.rb (revision 46617) @@ -2372,6 +2372,8 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/net/imap.rb#L2372 return body_type_msg when /\A(?:ATTACHMENT)\z/ni return body_type_attachment + when /\A(?:MIXED)\z/ni + return body_type_mixed else return body_type_basic end @@ -2454,6 +2456,13 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/net/imap.rb#L2456 return BodyTypeAttachment.new(mtype, nil, param) end + def body_type_mixed + mtype = "MULTIPART" + msubtype = case_insensitive_string + param, disposition, language, extension = body_ext_mpart + return BodyTypeBasic.new(mtype, msubtype, param, nil, nil, nil, nil, nil, disposition, language, extension) + end + def body_type_mpart parts = [] while true Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46616) +++ ruby_2_1/version.h (revision 46617) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-06-30" -#define RUBY_PATCHLEVEL 154 +#define RUBY_PATCHLEVEL 155 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_1/test/net/imap/test_imap_response_parser.rb =================================================================== --- ruby_2_1/test/net/imap/test_imap_response_parser.rb (revision 46616) +++ ruby_2_1/test/net/imap/test_imap_response_parser.rb (revision 46617) @@ -248,4 +248,14 @@ EOF https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/net/imap/test_imap_response_parser.rb#L248 assert_equal("CAPABILITY", response.name) assert_equal("AUTH=PLAIN", response.data.last) end + + def test_mixed_boundry + parser = Net::IMAP::ResponseParser.new + response = parser.parse("* 2688 FETCH (UID 179161 BODYSTRUCTURE ((\"TEXT\" \"PLAIN\" (\"CHARSET\" \"iso-8859-1\") NIL NIL \"QUOTED-PRINTABLE\" 200 4 NIL NIL NIL)(\"MESSAGE\" \"DELIVERY-STATUS\" NIL NIL NIL \"7BIT\" 318 NIL NIL NIL)(\"MESSAGE\" \"RFC822\" NIL NIL NIL \"7BIT\" 2177 (\"Tue, 11 May 2010 18:28:16 -0400\" \"Re: Welcome letter\" ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"David\" NIL \"info\" \"xxxxxxxx.si\")) ((\"Doretha\" NIL \"doretha.info\" \"xxxxxxxx.si\")) NIL NIL \"<AC1D15E06EA82F47BDE18E851CC32F330717704E@localdomain>\" \"<AANLkTikKMev1I73L2E7XLjRs67IHrEkb23f7ZPmD4S_9@localdomain>\") (\"MIXED\" (\"BOUNDARY\" \"000e0cd29212e3e06a0486590ae2\") NIL NIL) 37 NIL NIL NIL) \"REPORT\" (\"BOUNDARY\" \"16DuG.4XbaNOvCi.9ggvq.8Ipnyp3\" \"REPORT-TYPE\" \"delivery-status\") NIL NIL))\r\n") + empty_part = response.data.attr['BODYSTRUCTURE'].parts[2] + assert_equal(empty_part.lines, 37) + assert_equal(empty_part.body.media_type, 'MULTIPART') + assert_equal(empty_part.body.subtype, 'MIXED') + assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2') + end end Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r46331 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/