summaryrefslogtreecommitdiff
path: root/bin/feed2imap-cleaner
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-07-19 11:25:20 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-07-19 11:25:20 +0000
commit4a5321b0071bad598265901b04b5f918e3881566 (patch)
tree421ad77cd6579d0e8ec5751aadc9cd63e31136b9 /bin/feed2imap-cleaner
parent591f5ed2562b7eeecc9c5b6a8fe3d5d5fa5a6b93 (diff)
downloadfeed2imap-4a5321b0071bad598265901b04b5f918e3881566.tar.gz
feed2imap-4a5321b0071bad598265901b04b5f918e3881566.tar.bz2
feed2imap-4a5321b0071bad598265901b04b5f918e3881566.zip
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@34 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to '')
-rwxr-xr-xbin/feed2imap-cleaner32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/feed2imap-cleaner b/bin/feed2imap-cleaner
new file mode 100755
index 0000000..dc119f6
--- /dev/null
+++ b/bin/feed2imap-cleaner
@@ -0,0 +1,32 @@
+#!/usr/bin/ruby
+
+$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
+
+require 'feed2imap/feed2imap'
+require 'optparse'
+
+configf = ENV['HOME'] + '/.feed2imaprc'
+dryrun = false
+
+opts = OptionParser::new do |opts|
+ opts.banner = "Usage: feed2imap-cleaner [options]"
+ opts.separator ""
+ opts.separator "Options:"
+ opts.on("-d", "--dry-run", "Dont really remove messages") do |v|
+ dryrun = true
+ end
+ opts.on("-f", "--config <file>", "Select alternate config file") do |f|
+ configf = f
+ end
+end
+opts.parse!(ARGV)
+
+config = nil
+File::open(configf) { |f| config = F2IConfig::new(f) }
+config.imap_accounts.each_value do |ac|
+ ac.connect
+end
+config.feeds.each do |f|
+ f.imapaccount.cleanup(f.folder, dryrun)
+end
+