summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2009-09-03 11:14:42 +0200
committerLucas Nussbaum <lucas@lucas-nussbaum.net>2009-09-03 11:14:42 +0200
commitcbb4e79e91d3d6e61175f50fb5c3ef9c4f5cdd63 (patch)
tree5f1607c1766d6c3244bb13c10edc550ab5a372c5
parent606304b0fe02adcbb127bded67945bab5297a613 (diff)
downloadfeed2imap-cbb4e79e91d3d6e61175f50fb5c3ef9c4f5cdd63.tar.gz
feed2imap-cbb4e79e91d3d6e61175f50fb5c3ef9c4f5cdd63.tar.bz2
feed2imap-cbb4e79e91d3d6e61175f50fb5c3ef9c4f5cdd63.zip
Add support for Maildir
Allow delivering to local Maildir[0] boxes, with URLs specifying the path, like: maildir:/home/rotty/Maildir/.feeds.foobar [0] http://en.wikipedia.org/wiki/Maildir
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/config.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/feed2imap/config.rb b/lib/feed2imap/config.rb
index d8f3548..e3df569 100644
--- a/lib/feed2imap/config.rb
+++ b/lib/feed2imap/config.rb
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
require 'yaml'
require 'uri'
require 'feed2imap/imap'
+require 'feed2imap/maildir'
# Default cache file
DEFCACHE = ENV['HOME'] + '/.feed2imap.cache'
@@ -40,12 +41,17 @@ class F2IConfig
@updateddebug = (@conf['debug-updated'] and @conf['debug-updated'] != 'false')
@include_images = (@conf['include-images'] and @conf['include-images'] != 'false')
@imap_accounts = ImapAccounts::new
+ maildir_account = MaildirAccount::new
@conf['feeds'].each do |f|
if f['disable'].nil?
uri = URI::parse(f['target'].to_s)
path = URI::unescape(uri.path)
path = path[1..-1] if path[0,1] == '/'
- @feeds.push(ConfigFeed::new(f, @imap_accounts.add_account(uri), path, self))
+ if uri.scheme == 'maildir'
+ @feeds.push(ConfigFeed::new(f, maildir_account, path))
+ else
+ @feeds.push(ConfigFeed::new(f, @imap_accounts.add_account(uri), path, self))
+ end
end
end
end