gmailgem / gmail

A Rubyesque interface to Gmail, with all the tools you'll need.
Other
397 stars 119 forks source link

imap.rb:1198:in `get_tagged_response': Unknown command h18mb374317qvb (Net::IMAP::BadResponseError) #232

Closed gipsh closed 8 years ago

gipsh commented 8 years ago

Hi Guys,

I get the error with this simple code,

gmail = Gmail.connect($username, $password)
puts gmail.inbox.count

Running ubuntu 14.04.4 , gmail 0.6.0 and mail 2.64 and ruby 2.3.0p0

Same code on ubuntu 15.10 with ruby 2.3.1p112 works fine.

The full error stacktrace is


/home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/imap.rb:1198:in `get_tagged_response': Unknown command h18mb374317qvb (Net::IMAP::BadResponseError)
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/imap.rb:1250:in `block in send_command'
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/imap.rb:1232:in `send_command'
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/imap.rb:454:in `block in select'
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
    from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/imap.rb:452:in `select'
    from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/gmail-0.6.0/lib/gmail/client/base.rb:207:in `switch_to_mailbox'
    from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/gmail-0.6.0/lib/gmail/client/base.rb:164:in `block in mailbox'
    from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/gmail-0.6.0/lib/gmail/client/base.rb:161:in `synchronize'
    from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/gmail-0.6.0/lib/gmail/client/base.rb:161:in `mailbox'
    from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/gmail-0.6.0/lib/gmail/client/base.rb:184:in `inbox'
    from get-mail.rb:9:in `<main>'
hakanai commented 7 years ago

Is there a workaround for this? I'm getting it too, but I even tried updating to ruby 2.4.0 and it keeps happening.

WuTheFWasThat commented 7 years ago

happening to me too :(

rempargo commented 7 years ago

Either two of the following can be the reason for this:

See also attached screenshots. Gmail settings:

enable_imap_in_settings

Google account Settings:

configure_less_secure_apps
hakanai commented 7 years ago

Both of those were on and I ultimately had to enable 2-factor authentication to get it to work at all.

fguillen commented 3 years ago

I have all on:

Still I see the error:

.rbenv/versions/3.0.2/lib/ruby/3.0.0/net/imap.rb:1226:in `get_tagged_response': Unknown command z8mb388673000wrg (Net::IMAP::BadResponseError)

:/

This combination doesn't work either: