]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/postfixadmin_plugin.rb
Add domain_exists() to PostfixadminPlugin.
[mailshears.git] / 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 = []