* Improve and extend setup.sh
Add subcommands 'debug show-mail-logs', 'inspect', 'login'. Add option
'-c' to specify the name of the running container. Add option '-i' to
specify the image name.
* Add tests for setup.sh
This commit adds a script nammed 'listmailuser'. './setup.sh' uses this
this script for its subcommand './setup.sh email list'. A test have
been added too.
To setup the mailserver large snippets of shell code had to past in a
console. Instead of:
mkdir -p config
touch config/postfix-accounts.cf
docker run --rm \
-e MAIL_USER=user1@domain.tld \
-e MAIL_PASS=mypassword \
-ti tvial/docker-mailserver:latest \
/bin/sh -c 'echo "$MAIL_USER|$(doveadm pw -s SHA512-CRYPT -u
$MAIL_USER -p $MAIL_PASS)"' >> config/postfix-accounts.cf
you can specify:
./setup.sh email add user1@domain.tld mypassword
This wrapper script can be easily extended. It uses the scripts already
builtin.