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