ConradIrwin / em-imap

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

Has anyone used this recently? #23

Closed JohnMerlino1 closed 8 years ago

JohnMerlino1 commented 8 years ago

I try something very basic:

EM.run do
  delegate = EM::IMAP.new('imap.gmail.com',993,true)

  delegate.connect.bind! do
          delegate.login('myemail@gmail.com', 'password')
        end.bind! do
          delegate.select('INBOX')
        end.bind! do
          delegate.search(["SINCE", Time.now.strftime('%d-%b-%y')])
        end.bind! do |ids|    
          delegate.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

And this line fails right here:

delegate.search(["SINCE", Time.now.strftime('%d-%b-%y')])

with error: Could not parse command

However, if I switch it to:

delegate.search( ['1:2'])

Then it works. That is the only search option that appears to work. Everything else says 'Could not parse command'. Anyone know why this happens?