docker-mailserver/target/bin/listalias

14 lines
312 B
Plaintext
Raw Normal View History

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