From: Michael Orlitzky Date: Fri, 30 Oct 2015 01:49:29 +0000 (-0400) Subject: Add domain_exists() to PostfixadminPlugin. X-Git-Tag: 0.0.1~49 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=commitdiff_plain;h=a7905056b29b9e7b99bfb35b4b89bf0e56275597 Add domain_exists() to PostfixadminPlugin. --- 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 = []