Provide list{addresses,aliases,users,relocated} subcommands
The patch provides the list{addresses,aliases,users,relocated} subcommands to
the UI. All commands actually take the same path in the code and only one
query is run with different parameters for each case.
There are still two shortcomings:
1. With alias domains, the output order is not as one might want it, e.g.
foo@example.org
bar@example.org
foo@example.com
bar@example.com
when it should really be foo@ twice and then bar@ twice. I have not found
a way to modify the SQL accordingly.
2. The SELECT queries for Accounts, Alias and Relocated are hard-coded in
common.py.
# All parameters are described in pgsql_table(5) / PGSQL PARAMETERS
#
# The hosts that Postfix will try to connect to and query from.
hosts = localhost
# The user name and password to log into the pgsql server.
user = postfix
password = some_password
# The database name on the servers.
dbname = mailsys
# XXX see create_optional_types_and_functions.pgsql
# * line 9: type sender_login
# * line 26: function postfix_smtpd_sender_login_map + comment above
#
# The SQL query template used to search the database
query = SELECT login FROM postfix_smtpd_sender_login_map('%u', '%d')