f504d9c5560159d55e5ccbb900fbdd33fc9d76a8
[mailshears.git] / lib / prune / plugins / dovecot_mailstore.rb
1 require 'common/filesystem'
2 require 'common/mailstore'
3 require 'common/dovecot_mailstore_plugin'
4 require 'prune/prune_plugin'
5 require 'rm/plugins/dovecot_mailstore'
6
7 class DovecotMailstorePrune < DovecotMailstoreRm
8
9 include DovecotMailstorePlugin
10 include PrunePlugin
11
12
13 def get_leftover_domains(db_domains)
14 # Get the list of domains according to the filesystem.
15 fs_domains = self.get_domains_from_filesystem()
16
17 # Return the list of domains on the filesystem that aren't in the DB.
18 return (fs_domains - db_domains)
19 end
20
21 def get_leftover_accounts(db_accounts)
22 # Get the list of accounts according to the filesystem.
23 fs_domains = self.get_domains_from_filesystem()
24 fs_accounts = self.get_accounts_from_filesystem(fs_domains)
25
26 # And return the accounts on the filesystem that aren't in the DB.
27 return (fs_accounts - db_accounts)
28 end
29
30 end