dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
790 stars 123 forks source link

Net::IMAP::BadResponseError #7

Closed narkisr closed 11 years ago

narkisr commented 14 years ago

Hey, first thank you for your hard work, I keep getting:

irb(main):006:0> gmail.inbox.emails(:after => '2009-03-04', :before => '2009-03-15') Net::IMAP::BadResponseError: Unknown command i7if511808mue.17 from /usr/lib/ruby/1.8/net/imap.rb:985:in pick_up_tagged_response' from /usr/lib/ruby/1.8/net/imap.rb:976:inget_tagged_response' from /usr/lib/ruby/1.8/net/imap.rb:1034:in send_command' from /usr/lib/ruby/1.8/monitor.rb:242:insynchronize' from /usr/lib/ruby/1.8/net/imap.rb:1019:in send_command' from /usr/lib/ruby/1.8/net/imap.rb:398:inselect' from /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' from /usr/lib/ruby/1.8/net/imap.rb:396:inselect' from /var/lib/gems/1.8/gems/ruby-gmail-0.0.6/lib/gmail.rb:60:in in_mailbox' from /var/lib/gems/1.8/gems/ruby-gmail-0.0.6/lib/gmail/mailbox.rb:56:inemails' from (irb):6

justinko commented 14 years ago

I get this error on Ruby 1.8.6, but not with Ruby 1.8.7. Seems to be an issue with 1.8.6 imap library.

narkisr commented 14 years ago

Im using 1.8.7: ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

justinko commented 14 years ago

You're correct, it messes up on 1.8.7 also. It looks like the bug was introduced in version 0.0.5. I switched to 0.0.4 and no problems.

chris commented 14 years ago

I had this same issue with version 0.0.8 on Ruby 1.8.7, and MacOS X 10.6. I'm using a Google apps/domains account in case that makes a difference. Switching to version 0.0.4 alleviated the problem.

rodreegez commented 14 years ago

+1

yanowitz commented 14 years ago

The problem happens if you try to use gmail without a block to the initializer. This is because the Gmail class is trying to use Net::IMAP#disconnected? to detect authentication (I'm not sure if Net::IMAP semantics changed at some point or this has always been buggy). Regardless, the fix is to move the @imap.login in the initializer to before the block_given?. the Gmail#imap method itself needs to be rewritten, as simply claling login on a disconnected pipe will fail.

mihael commented 14 years ago

Count me in. I am having the same issue with version 0.0.9. I reverted to 0.0.4 like they did. Thanks.

schlick commented 13 years ago

I experienced this problem too when using the adimircolen-master branch (0dc36128015128548ed8). My problem was solved by switching over to Geoff Youngs fork (1f2ef64a562254c6da7d).

Eunoia commented 12 years ago

Hello! I found this error when google wanted me to verify the account. Verifying the account resolves the error.

myobie commented 11 years ago

I'm closing this out because of the age. Feel free to reopen this if a similar problem crops up.