setup-stack: fix error when RSPAMD_DMS_DKIM_D is not set

prevent messages like this
  chown: cannot access '': No such file or directory
when RSPAMD_DMS_DKIM_D has no value
This commit is contained in:
Andreas Perhab 2024-01-25 11:05:40 +01:00
parent ed1e1ebbd3
commit b36842cd59
1 changed files with 5 additions and 3 deletions

View File

@ -95,9 +95,11 @@ function _setup_apply_fixes_after_configuration() {
_log 'debug' 'Removing files and directories from older versions'
rm -rf /var/mail-state/spool-postfix/{dev,etc,lib,pid,usr,private/auth}
# /tmp/docker-mailserver/rspamd/dkim
_log 'debug' "Ensuring ${RSPAMD_DMS_DKIM_D} is owned by '_rspamd:_rspamd'"
chown -R _rspamd:_rspamd "${RSPAMD_DMS_DKIM_D}"
if [[ -n ${RSPAMD_DMS_DKIM_D} ]] ; then
# /tmp/docker-mailserver/rspamd/dkim
_log 'debug' "Ensuring ${RSPAMD_DMS_DKIM_D} is owned by '_rspamd:_rspamd'"
chown -R _rspamd:_rspamd "${RSPAMD_DMS_DKIM_D}"
fi
}
function _run_user_patches() {