2016-12-30 19:06:44 +00:00
|
|
|
#! /bin/bash
|
2016-08-29 11:44:36 +00:00
|
|
|
|
2021-01-16 09:16:05 +00:00
|
|
|
# shellcheck source=../scripts/helper-functions.sh
|
|
|
|
. /usr/local/bin/helper-functions.sh
|
2016-08-29 11:44:36 +00:00
|
|
|
|
2020-10-21 16:16:32 +00:00
|
|
|
DATABASE=${DATABASE:-/tmp/docker-mailserver/postfix-accounts.cf}
|
2016-08-29 11:44:36 +00:00
|
|
|
|
2020-10-21 16:16:32 +00:00
|
|
|
[[ -f ${DATABASE} ]] || errex "Error: No postfix-virtual.cf file"
|
|
|
|
[[ -s ${DATABASE} ]] || errex "Error: Empty postfix-virtual.cf - no aliases have been added"
|
2016-08-29 11:44:36 +00:00
|
|
|
|
2021-02-23 19:03:01 +00:00
|
|
|
{ grep -v "^\s*$\|^\s*\#" "${DATABASE}" || true ; } | awk -F '|' '{ print $1; }'
|
|
|
|
exit 0
|