From 8b6dd3fdcd5c5d0d52cab2d22623971c1adb1944 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 22 Jun 2008 13:14:45 +0000 Subject: [PATCH] IMAP: fetch unseen messages only. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1572 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/imap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine/imap.rb b/lib/redmine/imap.rb index aceb75cb2..a6cd958cd 100644 --- a/lib/redmine/imap.rb +++ b/lib/redmine/imap.rb @@ -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)