- rescue NonexistentAccountError => e
- report(plugin, "Account not found: #{e.to_s}")
- rescue StandardError => e
- report(plugin, "There was an error removing the account: #{e.to_s}")
- Kernel.exit(ExitCodes::DATABASE_ERROR)
- end
- else
- begin
- # We must delete all accounts belonging to the domain first.
- # This prevents us from leaving behind accounts. Not a
- # problem with the mailstore, since we'll delete the domain
- # directory anyway, but it is for the database plugins.
- usernames = plugin.get_domain_usernames(target)
- usernames.each { |u| run(plugin, u) }