]> gitweb.michael.orlitzky.com - mailshears.git/blob - src/dovecot_mailstore.rb
Added the get_domains_from_filesystem function to the DovecotMailstore class.
[mailshears.git] / src / dovecot_mailstore.rb
1 require 'src/filesystem'
2 require 'src/mailstore'
3
4 class DovecotMailstore < Mailstore
5
6 def get_domains_from_filesystem()
7 return Filesystem.get_subdirs(@domain_root)
8 end
9
10
11 def get_accounts_from_filesystem(domains)
12 accounts = []
13
14 domains.each do |domain|
15 domain_path = File.join(@domain_root, domain)
16 usernames = Filesystem.get_subdirs(domain_path)
17
18 usernames.each do |username|
19 accounts << "#{username}@#{domain}"
20 end
21 end
22
23 return accounts
24 end
25
26 end