Bug #5620

(Net::IMAP::ResponseParseError) unexpected token LBRA (expected SPACE)

Added by art lussos almost 4 years ago. Updated over 3 years ago.

[ruby-core:40945]
Status:Closed
Priority:Normal
Assignee:Shugo Maeda
ruby -v:ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] Backport:

Description

We have a found an issue with one of the IMAP servers ( IMAP4rev1) we connect to:

(Net::IMAP::ResponseParseError) unexpected token LBRA (expected SPACE)

.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/imap.rb:3235:in parse_error'
.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/imap.rb:3087:in
match'
.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/imap.rb:2226:in `rfc822_text'

What is happening is that this mail server is sending down:
RFC822[] {7000} when we FETCH RFC822, instead of the expected RFC822 {7000} -- notice the []

What I propose is that when we have a loop looking for the space and skip LBRA or T_RBRA.

In imap.rb

def rfc822_text
token = match(T_ATOM)

name = token.value.upcase
while true
token = lookahead
case token.symbol
when T_LBRA, T_RBRA
shift_token
when T_SPACE
shift_token
break
else
parse_error("unexpected token %s", token.symbol)
end
end

return name, nstring
end

Associated revisions

Revision 35054
Added by Shugo Maeda over 3 years ago

  • lib/net/imap.rb (rfc822_text): ignore [] after RFC822. [Bug #5620]

Revision 35054
Added by Shugo Maeda over 3 years ago

  • lib/net/imap.rb (rfc822_text): ignore [] after RFC822. [Bug #5620]

History

#1 Updated by Koichi Sasada over 3 years ago

  • Category set to lib
  • Assignee set to Shugo Maeda

#2 Updated by Shugo Maeda over 3 years ago

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

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


  • lib/net/imap.rb (rfc822_text): ignore [] after RFC822. [Bug #5620]

Also available in: Atom PDF