2016-12-30 20:06:44 +01:00
|
|
|
#! /bin/bash
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2021-01-16 10:16:05 +01:00
|
|
|
# shellcheck source=../scripts/helper-functions.sh
|
|
|
|
. /usr/local/bin/helper-functions.sh
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2020-10-21 18:16:32 +02:00
|
|
|
DATABASE=${DATABASE:-/tmp/docker-mailserver/postfix-accounts.cf}
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2020-10-21 18:16:32 +02: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 13:44:36 +02:00
|
|
|
|
2021-02-23 20:03:01 +01:00
|
|
|
{ grep -v "^\s*$\|^\s*\#" "${DATABASE}" || true ; } | awk -F '|' '{ print $1; }'
|
|
|
|
exit 0
|