IMAP: fetch unseen messages only.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1572 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-06-22 13:14:45 +00:00
parent 8b33565b3e
commit 8b6dd3fdcd
1 changed files with 1 additions and 1 deletions

View 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)