X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=lib%2Fprune%2Fplugins%2Fdovecot_mailstore.rb;fp=lib%2Fprune%2Fplugins%2Fdovecot_mailstore.rb;h=f504d9c5560159d55e5ccbb900fbdd33fc9d76a8;hb=e3826d8926e11763837a591986d453e9ef5d9dec;hp=0000000000000000000000000000000000000000;hpb=a6ae98f0423603445b621a8eaa17443c8d590b45;p=mailshears.git diff --git a/lib/prune/plugins/dovecot_mailstore.rb b/lib/prune/plugins/dovecot_mailstore.rb new file mode 100644 index 0000000..f504d9c --- /dev/null +++ b/lib/prune/plugins/dovecot_mailstore.rb @@ -0,0 +1,30 @@ +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