From a7905056b29b9e7b99bfb35b4b89bf0e56275597 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 29 Oct 2015 21:49:29 -0400 Subject: [PATCH] Add domain_exists() to PostfixadminPlugin. --- lib/common/postfixadmin_plugin.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/common/postfixadmin_plugin.rb b/lib/common/postfixadmin_plugin.rb index b14f295..97d59f2 100644 --- a/lib/common/postfixadmin_plugin.rb +++ b/lib/common/postfixadmin_plugin.rb @@ -57,6 +57,15 @@ module PostfixadminPlugin end + def domain_exists(domain) + # Does the given domain exist in Postfixadmin? We use a naive + # implementation here based on list_domains(). This isn't in our + # superclass because not all plugins have a concept of domains. + domains = list_domains() + return domains.include?(domain) + end + + def list_users() users = [] -- 2.44.2