require 'common/filesystem' require 'common/mailstore' require 'common/dovecot_mailstore_plugin' require 'prune/prune_plugin' require 'rm/plugins/dovecot_mailstore' class DovecotMailstorePrune < DovecotMailstoreRm include DovecotMailstorePlugin include PrunePlugin def get_leftover_domains(db_domains) # Get the list of domains according to the filesystem. fs_domains = self.get_domains_from_filesystem() # Return the list of domains on the filesystem that aren't in the DB. return (fs_domains - db_domains) end def get_leftover_accounts(db_accounts) # Get the list of accounts according to the filesystem. fs_domains = self.get_domains_from_filesystem() fs_accounts = self.get_accounts_from_filesystem(fs_domains) # And return the accounts on the filesystem that aren't in the DB. return (fs_accounts - db_accounts) end end