]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/prune/prune_runner.rb
1 require 'common/runner'
2 require 'prune/plugins/postfixadmin'
5 # Perform the pruning of users/domains using {PrunePlugin}s.
10 # Run *plugin* to prune leftover users and directories.
12 # @param cfg [Configuration] configuration options passed to
13 # {PostfixadminPrune}.
15 # @param plugin [Class] plugin class that will perform the pruning.
18 # We don't want to check the PostfixAdmin database against itself.
19 return if plugin
.class == PostfixadminPrune
21 pfa
= PostfixadminPrune
.new(cfg
)
23 db_users
= pfa
.list_users()
24 db_domains
= pfa
.list_domains()
26 leftovers
= plugin
.get_leftover_users(db_users
)
27 leftovers +
= plugin
.get_leftover_domains(db_domains
)
29 # We're counting on our PrunePlugin also being an RmPlugin here.
30 rm_runner
= RmRunner
.new()
31 rm_runner
.run(cfg
, plugin
, *leftovers
)