em-imap icon indicating copy to clipboard operation
em-imap copied to clipboard

uid_search does not work

Open JohnMerlino1 opened this issue 8 years ago • 0 comments

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('[email protected]', '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?

JohnMerlino1 avatar Sep 29 '16 00:09 JohnMerlino1