install_postfix_base.sh: update file 'sasl_passwd' instead ao renewing it.
This commit is contained in:
		| @@ -1103,11 +1103,20 @@ echo_ok | |||||||
| echononl "   Configure SASL authentification" | echononl "   Configure SASL authentification" | ||||||
| if $SASL_AUTH ; then | if $SASL_AUTH ; then | ||||||
|  |  | ||||||
|  |    _sasl_pw_file="/etc/postfix/sasl_passwd" | ||||||
|  |    if [[ -f "${_sasl_pw_file}" ]] && $(grep -q -E "^\[${RELAY_HOST}\]" ${_sasl_pw_file} 2> /dev/null); then | ||||||
|  |       sed -i "/^\[${RELAY_HOST}/d" ${_sasl_pw_file} | ||||||
|  |       if [[ "$?" != "0" ]]; then | ||||||
|  |          error "Setting \"/etc/postfix/sasl_passwd\" failed! " | ||||||
|  |          _failed=true | ||||||
|  |       fi | ||||||
|  |    fi | ||||||
|  |  | ||||||
|    _failed=false |    _failed=false | ||||||
|    if [[ ${RELAY_PORT} -ne 25 ]] ; then |    if [[ ${RELAY_PORT} -ne 25 ]] ; then | ||||||
|       echo "[$RELAY_HOST]:${RELAY_PORT} ${SASL_USER}@${RELAY_HOST}:$SASL_PASS" > /etc/postfix/sasl_passwd |       echo "[$RELAY_HOST]:${RELAY_PORT} ${SASL_USER}@${RELAY_HOST}:$SASL_PASS" >> /etc/postfix/sasl_passwd | ||||||
|    else |    else | ||||||
|       echo "[$RELAY_HOST] ${SASL_USER}@${RELAY_HOST}:$SASL_PASS" > /etc/postfix/sasl_passwd |       echo "[$RELAY_HOST] ${SASL_USER}@${RELAY_HOST}:$SASL_PASS" >> /etc/postfix/sasl_passwd | ||||||
|    fi |    fi | ||||||
|    if [[ "$?" != "0" ]]; then |    if [[ "$?" != "0" ]]; then | ||||||
|       error "Setting \"/etc/postfix/sasl_passwd\" failed! " |       error "Setting \"/etc/postfix/sasl_passwd\" failed! " | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user