]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/prune/plugins/dovecot.rb
Rename PostfixadminDb, RoundcubeDb without the Db suffix.
[mailshears.git] / lib / prune / plugins / dovecot.rb
diff --git a/lib/prune/plugins/dovecot.rb b/lib/prune/plugins/dovecot.rb
new file mode 100644 (file)
index 0000000..88e5c1c
--- /dev/null
@@ -0,0 +1,26 @@
+require 'prune/prune_plugin'
+require 'rm/plugins/dovecot'
+
+class DovecotPrune < DovecotRm
+
+  include PrunePlugin
+
+
+  def get_leftover_domains(db_domains)
+    # Get the list of domains according to the filesystem.
+    fs_domains = self.list_domains()
+
+    # Return the list of domains on the filesystem that aren't in the DB.
+    return (fs_domains - db_domains)
+  end
+
+  def get_leftover_accounts(db_accounts)
+    # Get the list of accounts according to the filesystem.
+    fs_domains = self.list_domains()
+    fs_accounts = self.list_domains_users(fs_domains)
+
+    # And return the accounts on the filesystem that aren't in the DB.
+    return (fs_accounts - db_accounts)
+  end
+
+end