##// END OF EJS Templates
IMAP: fetch unseen messages only....
Jean-Philippe Lang -
r1558:8b6dd3fdcd5c
parent child
Show More
@@ -29,7 +29,7 module Redmine
29 imap = Net::IMAP.new(host, port, ssl)
29 imap = Net::IMAP.new(host, port, ssl)
30 imap.login(imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
30 imap.login(imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
31 imap.select(folder)
31 imap.select(folder)
32 imap.search(['ALL']).each do |message_id|
32 imap.search(['NOT', 'SEEN']).each do |message_id|
33 msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822']
33 msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822']
34 logger.debug "Receiving message #{message_id}" if logger && logger.debug?
34 logger.debug "Receiving message #{message_id}" if logger && logger.debug?
35 if MailHandler.receive(msg, options)
35 if MailHandler.receive(msg, options)
General Comments 0
You need to be logged in to leave comments. Login now