summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-29 18:01:18 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-29 18:01:18 +0000
commitdfba910f74d4f99961ad296a07fcc0617c2960a4 (patch)
tree960be2a7290fd5b5977b04ef3f65b441c6303cf3 /lib
parentd681d9ce6744f5f7e819abf2cb10e89d4906a840 (diff)
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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/imap.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 55c611b9c6..1bb0b81eec 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -2372,6 +2372,8 @@ module Net
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
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