Replace 'account' with 'user' everywhere.
[mailshears.git] / lib / prune / plugins / dovecot.rb
1 require 'prune/prune_plugin'
2 require 'rm/plugins/dovecot'
3
4 class DovecotPrune < DovecotRm
5
6 include PrunePlugin
7
8
9 def get_leftover_domains(db_domains)
10 # Get the list of domains according to the filesystem.
11 fs_domains = self.list_domains()
12
13 # Return the list of domains on the filesystem that aren't in the DB.
14 return (fs_domains - db_domains)
15 end
16
17 def get_leftover_users(db_users)
18 # Get the list of users according to the filesystem.
19 fs_domains = self.list_domains()
20 fs_users = self.list_domains_users(fs_domains)
21
22 # And return the users on the filesystem that aren't in the DB.
23 return (fs_users - db_users)
24 end
25
26 end