]> gitweb.michael.orlitzky.com - mailshears.git/commitdiff
Add domain_exists() to PostfixadminPlugin.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Oct 2015 01:49:29 +0000 (21:49 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Oct 2015 01:49:29 +0000 (21:49 -0400)
lib/common/postfixadmin_plugin.rb

index b14f295031e4ff1178ec114ca483562604d394d4..97d59f267214060a7b9824d47338727e29b58b24 100644 (file)
@@ -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 = []