docker-mailserver/target/bin/listalias
2020-07-19 21:33:06 +02:00

14 lines
312 B
Bash
Executable file

#! /bin/bash
DATABASE=${DATABASE:-/tmp/docker-mailserver/postfix-virtual.cf}
errex() {
echo "$@" 1>&2
exit 1
}
[ -f $DATABASE ] || errex "Error: No postfix-virtual.cf file"
[ -s $DATABASE ] || errex "Error: Empty postfix-virtual.cf - no aliases have been added"
(grep -v "^\s*$\|^\s*\#" $DATABASE || true)