install_amavis.sh: fix some error writing file '50-user'.

This commit is contained in:
2026-02-13 23:46:22 +01:00
parent da1867ef91
commit 7741803f71

View File

@@ -4431,14 +4431,13 @@ EOF
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)"
fi fi
if [[ "${DB_TYPE}" = "PostgreSQL" ]] || [[ "${DB_TYPE}" = "MySQL" ]]; then if [[ "${DB_TYPE}" = "PostgreSQL" ]] || [[ "${DB_TYPE}" = "MySQL" ]]; then
if [[ "$DB_TYPE" = "PostgreSQL" ]]; then if [[ "$DB_TYPE" = "PostgreSQL" ]]; then
_db="psql" _db="pgsql"
else else
_db="mysql" _db="mysql"
fi fi
@@ -4450,7 +4449,6 @@ EOF
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)"
fi fi
@@ -4464,39 +4462,38 @@ EOF
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)"
fi fi
fi fi
if [[ -f "/etc/postfix/${_db}_relay-domain-maps.cf" ]]; then if [[ -f "/etc/postfix/${_db}_relay-domain-maps.cf" ]]; then
cat >> /etc/amavis/conf.d/50-user <<EOF cat >> /etc/amavis/conf.d/50-user <<EOF
# Domains, die als relay_domains akzeptiert werden: # Domains, die als Relay Domains akzeptiert werden:
'${_db}:/etc/postfix/${_db}_relay-domain-maps.cf', '${_db}:/etc/postfix/${_db}_relay-domain-maps.cf',
EOF EOF
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)"
fi fi
fi fi
if grep -iq -E "^\s*btree:/etc/postfix/relay_domains" $postfix_main_cf > /dev/null 2>&1 ; then
if grep -iq -E "^\s*btree:/etc/postfix/relay_domains" "/etc/postfix/main.cf" > /dev/null 2>&1 ; then
cat >> /etc/amavis/conf.d/50-user <<EOF cat >> /etc/amavis/conf.d/50-user <<EOF
# Domains, die als virtuelle Mailbox-Domains gehostet sind: # weiter Domains, die als Relay Domains akzeptiert werden
'${_db}:/etc/postfix/${_db}_relay-domain-maps.cf', 'btree:/etc/postfix/relay_domains',
EOF EOF
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)"
fi fi
@@ -4506,6 +4503,10 @@ EOF
); );
EOF EOF
echo ""
echo "hallo 9"
echo ""
else else
cat >> /etc/amavis/conf.d/50-user <<'EOF' cat >> /etc/amavis/conf.d/50-user <<'EOF'
@local_domains_maps = ( ["."] ); @local_domains_maps = ( ["."] );