+require 'common/plugin'
require 'pg'
-class PostfixadminDb
-
- def initialize(db_host,
- db_port,
- db_opts,
- db_tty,
- db_name,
- db_user,
- db_pass)
-
- @db_host = db_host
- @db_port = db_port
- @db_opts = db_opts
- @db_tty = db_tty
- @db_name = db_name
- @db_user = db_user
- @db_pass = db_pass
+module PostfixadminDbPlugin
+ # Code that all PostfixadminDb plugins (Prune, Rm, Mv...) will
+ # share. That is, we implement the Plugin interface.
+ include Plugin
+
+ def initialize()
+
+ cfg = Configuration.new()
+ @db_host = cfg.dbhost
+ @db_port = cfg.dbport
+ @db_opts = cfg.dbopts
+ @db_tty = cfg.dbtty
+ @db_name = cfg.dbname
+ @db_user = cfg.dbuser
+ @db_pass = cfg.dbpass
+ end
+
+
+ def describe_account(account)
+ # There's no other unique identifier in PostfixAdmin
+ return account
+ end
+
+
+ def describe_domain(domain)
+ # There's no other unique identifier in PostfixAdmin
+ return domain
end
return accounts
end
+
end