Imap not reading mail which are already read through a mail client

Hi
   I am trying to use 'net/imap' to get mail from a gmail account. I am
attaching the code. My problem is, suppose if a new mail comes to gmail
inbox and I have read that through either gmail directly or using
thunder bird. Then I can't read that using my code (which I am
attaching). Please help. I am using ruby 1.8.7

Thanks

Attachments:
http://www.ruby-forum.com/attachment/6154/imap.rb

···

--
Posted via http://www.ruby-forum.com/.

- From the code:
imap.uid_search(["NOT", "SEEN"]).each_with_index do |uid,i|

If you've read it in Gmail and/or Firefox, it's seen. You probably want:
imap.uid_search(["ALL"]).

Good luck!

···

On 5/2/2011 10:34 PM, Tom Mac wrote:

Hi
   I am trying to use 'net/imap' to get mail from a gmail account. I am
attaching the code. My problem is, suppose if a new mail comes to gmail
inbox and I have read that through either gmail directly or using
thunder bird. Then I can't read that using my code (which I am
attaching). Please help. I am using ruby 1.8.7

Thanks

Attachments:
http://www.ruby-forum.com/attachment/6154/imap.rb