Project

General

Profile

Backport #8415

Net::IMAP#capability_response raises "Net::IMAP::ResponseParseError: unexpected token CRLF" for common CAPABILITY

Added by peter@sanebox.com (Peter Kovacs) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:55024]

Description

Unfortunately Apple's iCloud IMAP service returns a non-conforming CAPABILITY response which causes this parse error to be raised:

"* CAPABILITY st11p00mm-iscream009 1Q49 XAPPLEPUSHSERVICE IMAP4 IMAP4rev1 SASL-IR AUTH=ATOKEN AUTH=PLAIN \r\n"

To reproduce:

require 'net/imap'
imap = Net::IMAP.new( 'imap.mail.me.com', 993, true )
imap.capability

To fix:

--- lib/ruby/2.0.0/net/imap.rb~ 2013-05-17 07:12:04.000000000 -0400
+++ lib/ruby/2.0.0/net/imap.rb 2013-05-17 07:13:05.000000000 -0400
@@ -2954,6 +2954,7 @@
break
when T_SPACE
shift_token

  • next end data.push(atom.upcase) end

This bug also applies to 1.8.7

Associated revisions

Revision 61b8250a
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 41091
Added by shugo (Shugo Maeda) almost 6 years ago

  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

Revision 52cdd867
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 41091: [Backport #8415]

* lib/net/imap.rb (capability_response): should ignore trailing
  spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 7e88248f
Added by usa (Usaku NAKAMURA) over 5 years ago

merge revision(s) 41091: [Backport #8415]

* lib/net/imap.rb (capability_response): should ignore trailing
  spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 41647
Added by usa (Usaku NAKAMURA) over 5 years ago

merge revision(s) 41091: [Backport #8415]

* lib/net/imap.rb (capability_response): should ignore trailing
  spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.

History

Updated by shugo (Shugo Maeda) almost 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)
#2

Updated by shugo (Shugo Maeda) almost 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41091.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/net/imap.rb (capability_response): should ignore trailing
    spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]

  • test/net/imap/test_imap_response_parser.rb: related test.

#3

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Category deleted (lib)
  • Status changed from Closed to Assigned
  • Assignee changed from shugo (Shugo Maeda) to nagachika (Tomoyuki Chikanaga)
#4

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r41188.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41091: [Backport #8415]

* lib/net/imap.rb (capability_response): should ignore trailing
  spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.
#5

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned
  • Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)

This is needed also in 1.9.3?
I move this ticket to Backport93 just for memorandum.

#6

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r41647.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41091: [Backport #8415]

* lib/net/imap.rb (capability_response): should ignore trailing
  spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.

Also available in: Atom PDF