Project

General

Profile

Actions

Bug #5616

closed

* /lib/net/imap.rb exception in IMAP.new when get_response returns nil

Added by boelen (Edsard Boelen) about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.8.7 (2011-02-18 patchlevel 334)
Backport:
[ruby-core:40938]

Description

The error occurred in ruby 1.8.7 when connecting to a buggy IMAP server. The error message was: Undefined method 'name' in imap.rb
It is this piece of code in line 915 (line 1067 in ruby 1.9.3):

  @greeting = get_response
  if @greeting.name == "BYE"
    @sock.close
    raise ByeResponseError, @greeting
  end

after a little search I saw that the function 'get_response' returns nil if the buffer is empty:

def get_response
  buff = ""
  while true
    ...
  end
  return nil if buff.length == 0
    ...
  return @parser.parse(buff)
end

Updated by ko1 (Koichi Sasada) over 9 years ago

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

Updated by shugo (Shugo Maeda) over 9 years ago

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

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


  • lib/net/imap.rb (initialize): raise Net::IMAP::Error when the connection is closed without a greeting response. [ruby-core:40938] [Bug #5616]
Actions

Also available in: Atom PDF