Fix for DKIM key permission after restoring backup

This commit is contained in:
dpeca 2016-12-28 17:11:41 +01:00
commit 7815539e91

View file

@ -517,6 +517,13 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
# Checking exim username for later chowning
exim_user="exim";
check_exim_username=$(grep -c '^Debian-exim:' /etc/passwd)
if [ "$check_exim_username" -eq 1 ]; then
exim_user="Debian-exim"
fi
# Restoring dns domain
for domain in $domains; do
echo -e "$(date "+%F %T") $domain" |tee -a $tmpdir/restore.log
@ -579,6 +586,11 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
-exec chown -h $user:mail {} \;
fi
fi
# Chowning mail conf files to exim user
find $HOMEDIR/$user/conf/mail/$domain_idn -user root \
-exec chown $exim_user {} \;
done
fi