ConradIrwin / em-imap

An event machine based IMAP client
MIT License
69 stars 31 forks source link

uid_search does not work #24

Open JohnMerlino1 opened 8 years ago

JohnMerlino1 commented 8 years ago

The uid_search method doesn't work:

EventMachine.run do
  imap = EM::IMAP.new('imap.gmail.com', 993, true)
  imap.connect.bind! do
    imap.login('user@gmail.com', 'password')
  end.bind! do
    imap.select('INBOX')
  end.bind! do
    imap.uid_search("2:*")
  end.bind! do |ids| 
    imap.fetch(ids, "(UID RFC822)")
  end.callback do |raw_messages|
    puts raw_messages
  end.errback do |error|   
    puts "Connecting or logging in failed: #{error}"
  end 
end

I am trying to pull the latest emails from the server. I get the error:

Could not parse command

Any way around this?