]> gitweb.michael.orlitzky.com - mailshears.git/blob - lib/prune/plugins/dovecot.rb
Get prune working, at least in a simple case.
[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_accounts(db_accounts)
18 # Get the list of accounts according to the filesystem.
19 fs_domains = self.list_domains()
20 fs_accounts = self.list_domains_users(fs_domains)
21
22 # And return the accounts on the filesystem that aren't in the DB.
23 return (fs_accounts - db_accounts)
24 end
25
26 end