]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/prune/plugins/roundcube.rb
Rename PostfixadminDb, RoundcubeDb without the Db suffix.
[mailshears.git] / lib / prune / plugins / roundcube.rb
diff --git a/lib/prune/plugins/roundcube.rb b/lib/prune/plugins/roundcube.rb
new file mode 100644 (file)
index 0000000..77eacfc
--- /dev/null
@@ -0,0 +1,25 @@
+require 'pg'
+
+require 'prune/prune_plugin'
+require 'rm/plugins/roundcube'
+
+class RoundcubePrune < RoundcubeRm
+
+  include PrunePlugin
+
+
+  def get_leftover_domains(db_domains)
+    # Roundcube doesn't have a concept of domains. We could parse the
+    # usernames to see what domains are present, but the point is
+    # moot: all leftover accounts will be pruned anyway.
+    return []
+  end
+
+
+  def get_leftover_accounts(db_accounts)
+    # Get a list of all users who have logged in to Roundcube.
+    rc_accounts = self.list__users()
+    return rc_accounts - db_accounts
+  end
+
+end