Fetch older emails first (to keep possibility for references header follow up detection).

This commit is contained in:
Martin Edenhofer 2016-06-02 16:00:45 +02:00
parent 0ab918dadc
commit 52043bfdc5

View file

@ -85,7 +85,12 @@ returns
@imap.select(options[:folder]) @imap.select(options[:folder])
end end
begin
message_ids = @imap.sort(['DATE'], ['ALL'], 'US-ASCII')
rescue => e
Rails.logger.error "Unable to use imap sort: #{e.inspect}, use imap search now"
message_ids = @imap.search(['ALL']) message_ids = @imap.search(['ALL'])
end
# check mode only # check mode only
if check_type == 'check' if check_type == 'check'