install_opendmarc.sh: change 'Socket' parameter, adjust ignor.host file.

This commit is contained in:
Christoph 2021-04-29 17:41:50 +02:00
parent e3e66b7208
commit 2222b9b6f3

View File

@ -12,29 +12,6 @@ echo -e "\n \033[32mStart Installation of OpenDMARC..\033[m"
#_src_base_dir="$(realpath $(dirname $0))"
#conf_file="${_src_base_dir}/conf/install_opendmarc.conf"
config_file_name_value_parameters="
AuthservID:OpenDMARC
PidFile:/var/run/opendmarc/opendmarc.pid
RejectFailures:true
Syslog:true
SyslogFacility:mail
TrustedAuthservIDs:localhost,$(hostname -f)
IgnoreHosts:/etc/opendmarc/ignore.hosts
IgnoreAuthenticatedClients:true
RequiredHeaders:true
UMask:002
FailureReports:false
AutoRestart:true
HistoryFile:/var/log/opendmarc.log
SPFSelfValidate:true
"
declare -a config_file_name_value_parameter_arr=()
for _conf in $config_file_name_value_parameters ; do
config_file_name_value_parameter_arr+=("$_conf")
done
log_file="$(mktemp)"
_opendmarc_packages="opendmarc"
opendmarc_base_dir="/etc/opendmarc"
@ -45,9 +22,33 @@ postfix_spool_dir="/var/spool/postfix"
opendmarc_socket_dir="${postfix_spool_dir}/opendmarc"
opendmarc_socket_file="${opendmarc_socket_dir}/opendmarc.sock"
config_file_name_value_parameters="
AuthservID|OpenDMARC
PidFile|/var/run/opendmarc/opendmarc.pid
RejectFailures|true
Syslog|true
SyslogFacility|mail
TrustedAuthservIDs|localhost,$(hostname -f)
IgnoreHosts|/etc/opendmarc/ignore.hosts
IgnoreAuthenticatedClients|true
RequiredHeaders|true
UMask|002
FailureReports|false
AutoRestart|true
HistoryFile|/var/log/opendmarc.log
SPFSelfValidate|true
Socket|${opendmarc_socket_file}
"
declare -a config_file_name_value_parameter_arr=()
for _conf in $config_file_name_value_parameters ; do
config_file_name_value_parameter_arr+=("$_conf")
done
postfix_needs_restart=false
opendmarc_needs_restart=false
log_file="$(mktemp)"
# -------------
# --- Some functions
# -------------
@ -196,7 +197,7 @@ else
fi
for _val in "${config_file_name_value_parameter_arr[@]}" ; do
IFS=':' read -a _val_arr <<< "${_val}"
IFS='|' read -a _val_arr <<< "${_val}"
echononl " $opendmarc_conf_file: ${_val_arr[0]} -> ${_val_arr[1]}.."
if $(grep -E -q "^\s*${_val_arr[0]}\s+${_val_arr[1]}\s*$" $opendmarc_conf_file 2> /dev/null) ; then
@ -283,9 +284,10 @@ if [[ -f "${opendmarc_base_dir}/ignore.hosts" ]] ; then
echo_skipped
else
cat <<EOF > ${opendmarc_base_dir}/ignore.hosts 2> $log_file
127.0.0.1
::1
localhost
# We are using AmaViS at 'localhost 127.0.0.1 . So we cannot bypass them
#
# 127.0.0.1
# localhost
$(hostname -f)
EOF
opendmarc_needs_restart=true