Add code to test users with postmap
postmap is a command line tool that can be used (pointed at the DB's query configuration files that postfix uses) to do queries.
To make testing user configuration easier, a few things are needed:
- Add a way to specify the default path of
- Add function (part of
SupportsVirtualAliasLookuptrait?) that runs the command
- Add the functionality to either
Postfix(since it's config files must be written out prior)
- Expose from CLI, something like
postmgr postfix mailbox-user-test -e <email>to test that a user is findable by email using virtual alias lookup and what not.
How this test currently goes if run manually (from inside container):
# postmgr postfix db-init ... output ... # postmgr postfix config generate-files ... output ... # postmgr postfix mailbox-user-add -e [email protected] -p test ... output ... # postmap -q [email protected] sqlite:/usr/src/postmgr/infra/runtime/config/postfix/valias_lookup.cf example.com/test/
postmap command returns a 0 code, which shows that the query is working.