]> source.dussan.org Git - redmine.git/commitdiff
IMAP: fetch unseen messages only.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 22 Jun 2008 13:14:45 +0000 (13:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 22 Jun 2008 13:14:45 +0000 (13:14 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1572 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/imap.rb

index aceb75cb29bc421b3784f1ad90704139cab48596..a6cd958cdcca6cc559e6a3c62b430cb83ac70625 100644 (file)
@@ -29,7 +29,7 @@ module Redmine
         imap = Net::IMAP.new(host, port, ssl)        
         imap.login(imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
         imap.select(folder)
-        imap.search(['ALL']).each do |message_id|
+        imap.search(['NOT', 'SEEN']).each do |message_id|
           msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822']
           logger.debug "Receiving message #{message_id}" if logger && logger.debug?
           if MailHandler.receive(msg, options)