diff options
Diffstat (limited to 'postfix')
-rwxr-xr-x | postfix/postfix.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 5c2d5b8..5dc4606 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -29,12 +29,14 @@ exit1() { exit 1 } +REDPILL=${REDPILL:-REDPILL} +REALM=${REALM:-ORG} + TLS_CERT=${TLS_CERT:-/etc/ssl/certs/postfix.pem} TLS_KEY=${TLS_KEY:-/etc/ssl/private/postfix.pem} -realmsdir='/etc/local-REDPILL' -configdirs='/etc/local /etc/local-ORG /etc/local-REDPILL /etc/local-COMMON' -confdir='/etc/postfix' +realmsdir="/etc/local-$REDPILL" +confdir="/etc/postfix" if ! [ -d "$realmsdir" ]; then warn "Realms directory \"$realmsdir\" does not exist." fi @@ -104,7 +106,7 @@ catfilefromownrealm() { file="$1" [ -d "$realmsdir" ] || exit 0 - thisrealm="$(cat /etc/local-ORG/realm || dnsdomainname | tr '[a-z]' '[A-Z]')" + thisrealm="$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[a-z]' '[A-Z]')" cat "$realmsdir/$thisrealm/$file" } @@ -116,7 +118,7 @@ catallfilesfromotherrealms() { [ -f "$realmsdir/realms" ] || exit 0 realms="$(cat "$realmsdir/realms" | sed 's/#.*//')" - thisrealm="$(cat /etc/local-ORG/realm || dnsdomainname | tr '[a-z]' '[A-Z]')" + thisrealm="$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[a-z]' '[A-Z]')" for realm in $realms; do if [ "$thisrealm" != "$realm" ]; then @@ -130,7 +132,7 @@ catfirstfile() { file="$1" context="${2:-postfix}" configdir='' - for dir in $configdirs; do + for dir in /etc/local "/etc/local-$REALM" "/etc/local-$REDPILL" /etc/local-COMMON; do if [ -d "$dir/$context" ] && [ -f "$dir/$context/$file" ]; then configdir="$dir/$context" break |