From: Michael Orlitzky Date: Sun, 13 Jun 2010 15:40:23 +0000 (-0400) Subject: Added the get_domains_from_filesystem function to the DovecotMailstore class. X-Git-Tag: 0.0.1~147 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=198f0d2d3198311e4ccdf988cb5996f585071014;p=mailshears.git Added the get_domains_from_filesystem function to the DovecotMailstore class. Make get_accounts_from_filesystem take its list of domains as a parameter. --- diff --git a/src/dovecot_mailstore.rb b/src/dovecot_mailstore.rb index 187b6b0..a794032 100644 --- a/src/dovecot_mailstore.rb +++ b/src/dovecot_mailstore.rb @@ -3,15 +3,18 @@ require 'src/mailstore' class DovecotMailstore < Mailstore - def get_accounts_from_filesystem() + def get_domains_from_filesystem() + return Filesystem.get_subdirs(@domain_root) + end + + + def get_accounts_from_filesystem(domains) accounts = [] - - domains = Filesystem.get_subdirs(@domain_root) - + domains.each do |domain| domain_path = File.join(@domain_root, domain) usernames = Filesystem.get_subdirs(domain_path) - + usernames.each do |username| accounts << "#{username}@#{domain}" end @@ -19,5 +22,5 @@ class DovecotMailstore < Mailstore return accounts end - + end