Backport #8415

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

Added by Peter Kovacs 11 months ago. Updated 10 months ago.

[ruby-core:55024]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

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 TSPACE
shift
token
+ next
end
data.push(atom.upcase)
end

This bug also applies to 1.8.7

Associated revisions

Revision 41647
Added by Usaku NAKAMURA 10 months ago

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

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

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

History

#1 Updated by Shugo Maeda 11 months ago

  • Status changed from Open to Assigned
  • Assignee set to Shugo Maeda

#2 Updated by Shugo Maeda 11 months 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. [Bug #8415]

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

#3 Updated by Tomoyuki Chikanaga 11 months 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 Maeda to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga 10 months 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.   [Bug #8415]

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

#5 Updated by Tomoyuki Chikanaga 10 months ago

  • Project changed from Backport200 to Backport93
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to Usaku NAKAMURA

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

#6 Updated by Usaku NAKAMURA 10 months 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.   [Bug #8415]

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

Also available in: Atom PDF