From 198f0d2d3198311e4ccdf988cb5996f585071014 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 13 Jun 2010 11:40:23 -0400 Subject: [PATCH] Added the get_domains_from_filesystem function to the DovecotMailstore class. Make get_accounts_from_filesystem take its list of domains as a parameter. --- src/dovecot_mailstore.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 -- 2.43.2