From: Paul Boekholt Date: 2008-12-05T05:13:19+09:00 Subject: [ruby-core:20320] [Bug #823] bad error recovery in Net::IMAP Bug #823: bad error recovery in Net::IMAP http://redmine.ruby-lang.org/issues/show/823 Author: Paul Boekholt Status: Open, Priority: Normal Hi, this code in imap.rb def send_command(cmd, *args, &block) synchronize do tag = Thread.current[:net_imap_tag] = generate_tag put_string(tag + " " + cmd) args.each do |i| put_string(" ") send_data(i) end put_string(CRLF) is causing problems when send_data raises a DataFormatError. An example: Net::IMAP.debug=1 begin data = client.fetch 0, "BODY[TEXT]" rescue Net::IMAP::DataFormatError end timeout(10) do data = client.fetch 1, "BODY[TEXT]" end C: RUBY0005 FETCH RUBY0006 FETCH 1 BODY[TEXT] S: RUBY0005 BAD Could not parse command /usr/local/lib/ruby/1.9.0/thread.rb:68:in `sleep': execution expired (Timeout::Error) The RUBY0005 got sent, but no CRLF. So the tag RUBY0006 is never seen by the server and the client waits forever for a response to RUBY0006. ---------------------------------------- http://redmine.ruby-lang.org