diff --git a/Rakefile b/Rakefile index 2a1737a..e3491cc 100644 --- a/Rakefile +++ b/Rakefile @@ -48,7 +48,7 @@ s.summary = "RSS/Atom feed aggregator" s.name = PKG_NAME s.version = PKG_VERSION - s.add_runtime_dependency 'ruby-feedparser', '0.9' + s.add_runtime_dependency 'ruby-feedparser', '>= 0.9' s.require_path = 'lib' s.executables = PKG_FILES.grep(%r{\Abin\/.}).map { |bin| bin.gsub(%r{\Abin/}, '') diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb index 7f4a176..64663c6 100644 --- a/lib/feed2imap/feed2imap.rb +++ b/lib/feed2imap/feed2imap.rb @@ -18,7 +18,7 @@ =end # Feed2Imap version -F2I_VERSION = '1.2.2' +F2I_VERSION = '1.2.3' F2I_WARNFETCHTIME = 10 require 'feed2imap/config' diff --git a/lib/feed2imap/maildir.rb b/lib/feed2imap/maildir.rb index 8a5ade1..7335f03 100644 --- a/lib/feed2imap/maildir.rb +++ b/lib/feed2imap/maildir.rb @@ -61,7 +61,7 @@ guarantee_maildir(dir) del_count = 0 - recent_time = Time.now() -- (3 * 24 * 60 * 60) # 3 days + recent_time = Time.now() - (3 * 24 * 60 * 60) # 3 days Dir[File.join(dir, 'cur', '*')].each do |fn| flags = maildir_file_info_flags(fn) # don't consider not-seen, flagged, or recent messages diff --git a/test/maildir/cur/1376317520.15789_1.debian:2,S b/test/maildir/cur/1376317520.15789_1.debian:2,S new file mode 100644 index 0000000..09df924 --- /dev/null +++ b/test/maildir/cur/1376317520.15789_1.debian:2,S @@ -0,0 +1,11 @@ +Date: Mon, 12 Aug 2013 16:25:20 +0200 +From: Antonio Terceiro +To: terceiro@debian.org +Subject: UTF-8 data: =?iso-8859-1?B?4ent8/o=?= +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.5.21 (2010-09-15) + +This is a sample email diff --git a/test/tc_maildir.rb b/test/tc_maildir.rb index cf9f8e3..7df47b8 100644 --- a/test/tc_maildir.rb +++ b/test/tc_maildir.rb @@ -20,6 +20,10 @@ def test_cleanup folder = create_maildir msgs = message_count(folder) + + four_days_ago = Time.now - (4 * 24 * 60 * 60) + old_message = Dir.glob(File.join(folder, '**/*:2,S')).first + FileUtils.touch old_message, mtime: four_days_ago maildir_account.cleanup(folder)