scripts: touchups for v12.0.0 (#3144)

This commit is contained in:
Georg Lauterbach 2023-03-04 10:57:42 +01:00 committed by GitHub
parent 5e9849d94f
commit 8ec5dbec74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 33 deletions

View file

@ -1,5 +1,16 @@
#!/bin/bash
function _setup_logs_general
{
_log 'debug' 'Setting up general log files'
# File/folder permissions are fine when using docker volumes, but may be wrong
# when file system folders are mounted into the container.
# Set the expected values and create missing folders/files just in case.
mkdir -p /var/log/{mail,supervisor}
chown syslog:root /var/log/mail
}
function _setup_logrotate
{
_log 'debug' 'Setting up logrotate'

View file

@ -82,13 +82,11 @@ function _setup_save_states
chown -R postfix:root /var/mail-state/spool-postfix
chown root:root /var/mail-state/spool-postfix
# These two require the postdrop(103) group:
chgrp -R postdrop /var/mail-state/spool-postfix/maildrop
chgrp -R postdrop /var/mail-state/spool-postfix/public
# These all have root ownership at the src location:
chown -R root /var/mail-state/spool-postfix/dev
chown -R root /var/mail-state/spool-postfix/etc
chown -R root /var/mail-state/spool-postfix/lib
chown -R root /var/mail-state/spool-postfix/pid
chown -R root /var/mail-state/spool-postfix/usr
chgrp -R postdrop /var/mail-state/spool-postfix/{maildrop,public}
elif [[ ${ONE_DIR} -eq 1 ]]
then
_log 'warn' "'ONE_DIR=1' but no volume was mounted to '${STATEDIR}'"
else
_log 'debug' 'Not consolidating state (because it has been disabled)'
fi
}

View file

@ -174,6 +174,15 @@ function __setup__security__clamav
if [[ ${ENABLE_CLAMAV} -eq 1 ]]
then
_log 'debug' 'Enabling and configuring ClamAV'
local FILE
for FILE in /var/log/mail/{clamav,freshclam}.log
do
touch "${FILE}"
chown clamav:adm "${FILE}"
chmod 640 "${FILE}"
done
if [[ ${CLAMAV_MESSAGE_SIZE_LIMIT} != '25M' ]]
then
_log 'trace' "Setting ClamAV message scan size limit to '${CLAMAV_MESSAGE_SIZE_LIMIT}'"