summaryrefslogtreecommitdiff
path: root/postfix/mkpostfixconfig.sh
blob: 828af13e618b5acd6b798eb241cb74a3ed7a50ab (plain)
  1. #!/bin/sh
  2. set -e
  3. basedir="$(dirname "$0")/.."
  4. domains="$(cat "$basedir/realms" | sed 's/#.*//')"
  5. exit1() {
  6. response="${1:+Error: }${1:-Internal error!}"
  7. echo "$response"
  8. exit 1
  9. }
  10. for domain in $domains; do
  11. [ -r "$basedir/$domain/mailnetworks" ] || exit1 "Could not read input file $basedir/$domain/mailnetworks"
  12. done
  13. echo '' > "$basedir/postfix/permit_mx_backup_networks"
  14. for domain in $domains; do
  15. cat "$basedir/$domain/mailnetworks" >> "$basedir/postfix/permit_mx_backup_networks"
  16. done