Make get_accounts_from_filesystem take its list of domains as a parameter.
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
return accounts
end
-
+
end