X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Frm_dummy_runner.rb;h=2ab25e80a3e402f5ba3c21214b30a768d6c2cd2c;hp=9bdd13f5f47fb2dc1b71e7c012545c47c08e7e4a;hb=f819b178c5c1cb8adda0182c610e5c52fad8bea7;hpb=51f027b01e242737956c3ab5aecdd322d6ceeeed diff --git a/lib/rm/rm_dummy_runner.rb b/lib/rm/rm_dummy_runner.rb index 9bdd13f..2ab25e8 100644 --- a/lib/rm/rm_dummy_runner.rb +++ b/lib/rm/rm_dummy_runner.rb @@ -5,16 +5,18 @@ class RmDummyRunner def run(plugin, *targets) targets.each do |target| - if target.include?('@') then - puts "Would remove account: #{target}" - # TODO: remove from postfixadmin as well. - else - usernames = plugin.get_domain_usernames(target) - usernames.each { |u| run(plugin, u) } + target_description = plugin.describe(target) + msg = "Would remove #{target.class.to_s().downcase()} #{target}" - puts "Would remove domain: #{target}" - # TODO: remove from postfixadmin as well. + # Only append the extra description if it's useful. + if not target_description.nil? and + not target_description.empty? and + not target_description == target.to_s() then + msg += " (#{target_description})" end + msg += '.' + + report(plugin, msg) end end