1175: specify user for cron.d freshclam file (#1176)

* 1175: specify user for cron.d freshclam file

* Fix Dovecot SSL parameters and generate dhparams as for Postfix

* Fixed broken unit tests
This commit is contained in:
Erik Wramner 2019-07-23 16:12:12 +02:00 committed by Thomas VIAL
parent adf3d8e1b3
commit 603dbbd7b0
5 changed files with 47 additions and 8 deletions

View file

@ -15,6 +15,16 @@ if [ ! -f postfix-accounts.cf ]; then
exit
fi
# Determine postmaster address, duplicated from start-mailserver.sh
# This script previously didn't work when POSTMASTER_ADDRESS was empty
if [[ -n "${OVERRIDE_HOSTNAME}" ]]; then
DOMAINNAME=$(echo "${OVERRIDE_HOSTNAME}" | sed s/[^.]*.//)
else
DOMAINNAME="$(hostname -d)"
fi
PM_ADDRESS="${POSTMASTER_ADDRESS:=postmaster@${DOMAINNAME}}"
echo "${log_date} Using postmaster address ${PM_ADDRESS}"
# create an array of files to monitor (perhaps simple *.cf would be ok here)
declare -a cf_files=()
for file in postfix-accounts.cf postfix-virtual.cf postfix-aliases.cf; do
@ -37,8 +47,11 @@ chksum=$(sha512sum -c --ignore-missing chksum)
if [[ $chksum == *"FAIL"* ]]; then
echo "${log_date} Change detected"
# Bug alert! This overwrites the alias set by start-mailserver.sh
# Take care that changes in one script are propagated to the other
#regen postix aliases.
echo "root: ${POSTMASTER_ADDRESS}" > /etc/aliases
echo "root: ${PM_ADDRESS}" > /etc/aliases
if [ -f /tmp/docker-mailserver/postfix-aliases.cf ]; then
cat /tmp/docker-mailserver/postfix-aliases.cf>>/etc/aliases
fi