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

Add more advanced label functions and searching. #32

Closed geoffyoungs closed 11 years ago

geoffyoungs commented 13 years ago

In GMail

adimircolen commented 13 years ago

geoffyoungs Do you can help me test on branch adimircolen-master ? RakeFile on line gem.add_dependency('mime', '>= 0.1') is nessesary or not ? Thanks you

geoffyoungs commented 13 years ago

Hi admircolen - I'm not sure whether that's need?

I've only been looking at read/search functionality rather than packaging concerns - I just want the ability to write code for a cron job like:

gmail.label('Errors').
emails(:before => 3.days.ago, :after => 1.week.ago).
with_label(gmail.inbox_label).each do |message|
  message.archive!
end

and thus get the delayed filters that gmail hasn't implemented...

adimircolen commented 13 years ago

I put this version as a release, we have few tests in gem. We need more tests.

geoffyoungs commented 13 years ago

AFAICT the mime gem isn't required - I've removed that line from the gmail/message.rb

And I've made the current set of tests work again - although I haven't got around to writing any new tests yet.

I've also added a Gemfile so we can use bundler to check that local gems aren't being pulled in by mistake.

geoffyoungs commented 13 years ago

Ok - there are some more fixes and additional tests for the search functionality.

Ken-g6 commented 12 years ago

@geoffyoungs ,

I'm using your branch of ruby-gmail, mainly for the advanced searching features. For instance, I want to be able to search emails by subject. The problem is it doesn't seem to be working.

To summarize, I use:

params={'subject'=>'A word or phrase'}
gmail = Gmail.new(username, password)
email = gmail.inbox.emails(params).to_a.last

And I expect that email will be the last email that had 'A word or phrase' in the subject. But it seems to be returning the last email with anything in the subject.

I would have left this in your branch's issues; but you don't seem to have that enabled.

myobie commented 11 years ago

This is a very large set of commits and I don't think I can pull these in, I'm sorry. After I get all the other issues closed, I may come back to this.

hoverlover commented 10 years ago

I am needing to search a mailbox for emails from OR to a specific address. This PR seems like it would do that. Are there any plans to pull this in?

myobie commented 10 years ago

I did not plan to pull this in since it's so untested and so many changes all at once. The focus of the project now is not on adding features to the current version but on organizing for a rewrite.