Search code examples
rubyimapuid

How to search emails that are not listed in a given MessageUIds using IMAP?


I'm using http://ruby-doc.org/stdlib/libdoc/net/imap/rdoc/index.html to access gmail.

I can search for emails with a particular label, but I'm trying to avoid to search an email twice.

So in order to do that, I thought that I could store the message_id of each email so that in the next searches I would reefer to that message_id to avoid searching for that email.

Do you know how can I do to search emails that are not part of a given email message_id list?

Thanks a lot for your time!


Solution

  • Rather than storing message ids, why don't you just search after a certain message date (which would be the date of your last search)?