diff options
Diffstat (limited to 'postfix')
-rwxr-xr-x | postfix/mkpostfixconfig.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/postfix/mkpostfixconfig.sh b/postfix/mkpostfixconfig.sh index 682f89b..d5a91ed 100755 --- a/postfix/mkpostfixconfig.sh +++ b/postfix/mkpostfixconfig.sh @@ -6,6 +6,16 @@ basedir="/etc/local-REDPILL" domains="$(cat "$basedir/realms" | sed 's/#.*//')" +exit1() { + response="${1:+Error: }${1:-Internal error!}" + echo "$response" + exit 1 +} + +for domain in $domains; do + [ -r "$basedir/$domain/mailnetworks" ] || exit1 "Could not read input file $basedir/$domain/mailnetworks" +done + echo '' > "$basedir/postfix/permit_mx_backup_networks" for domain in $domains; do cat "$basedir/$domain/mailnetworks" >> "$basedir/postfix/permit_mx_backup_networks" |