# share. That is, we implement the Plugin interface.
include Plugin
- def initialize()
-
- cfg = Configuration.new()
+ def initialize(cfg)
@db_host = cfg.postfixadmin_dbhost
@db_port = cfg.postfixadmin_dbport
@db_opts = cfg.postfixadmin_dbopts
end
- def describe_account(account)
+ def describe_user(user)
# There's no other unique identifier in PostfixAdmin
- return account
+ return user
end
def list_users()
- accounts = []
+ users = []
# Just assume PostgreSQL for now.
begin
# deliver to that address; it's not an alias."
sql_query = 'SELECT username FROM mailbox;'
connection.query(sql_query) do |result|
- accounts = result.field_values('username')
+ users = result.field_values('username')
end
connection.close()
rescue PGError => e
raise DatabaseError.new(e)
end
- return accounts
+ return users
end