Project

General

Profile

Actions

Backport #8415

closed

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

Added by peter@sanebox.com (Peter Kovacs) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
[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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0