]>
gitweb.michael.orlitzky.com - mailshears.git/blob - rm_runner.rb
5fe2eaf933bf7d073a200f23381718ac60529b31
4 def run(plugin
, *targets
)
5 targets
.each
do |target
|
6 # Why think too hard? An account has an @, a domain doesn't.
7 if target
.include?('@') then
9 account_description
= plugin
.describe_account(target
)
10 plugin
.delete_account(target
)
11 puts
"Removed account: #{target} (#{account_description})"
12 rescue StandardError
=> e
13 puts
"There was an error removing the account: #{e.to_s}"
14 Kernel
.exit(ExitCodes
::DATABASE_ERROR)
18 # TODO: Delete all accounts first.
19 domain_description
= plugin
.describe_domain(target
)
20 plugin
.delete_domain(target
)
21 puts
"Removed domain: #{target} (#{domain_description})"
22 rescue StandardError
=> e
23 puts
"There was an error removing the domain: #{e.to_s}"
24 Kernel
.exit(ExitCodes
::DATABASE_ERROR)
29 # TODO: remove from postfixadmin as well.