This commit is contained in:
Pablo Baenas 2025-04-27 14:25:49 +00:00 committed by GitHub
commit bdad7b4e95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 3 deletions

View file

@ -109,7 +109,12 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
# Set ownership
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
# Checking if dovecot user exists before set dovecot as owner. If dovecot user doesn't exist (dovecot is not installed), owner is assign to Exim user
if id "dovecot" >/dev/null 2>&1; then
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
else
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain/passwd
fi
chown $user:mail $HOMEDIR/$user/mail/$domain_idn
fi

View file

@ -526,7 +526,13 @@ rebuild_mail_domain_conf() {
chmod 771 /etc/$MAIL_SYSTEM/domains/$domain_idn
chmod 770 $HOMEDIR/$user/mail/$domain_idn
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
# Checking if dovecot user exists before set dovecot as owner. If dovecot user doesn't exist (dovecot is not installed), owner is assign to Exim user
if id "dovecot" >/dev/null 2>&1; then
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
else
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain/passwd
fi
chown $user:mail $HOMEDIR/$user/mail/$domain_idn
fi

View file

@ -5,7 +5,13 @@ if [ -e "/etc/exim4/domains/" ]; then
domain_link=$(readlink /etc/exim4/domains/$domain)
chown Debian-exim:mail $domain_link
chown Debian-exim:mail /etc/exim4/domains/$domain/*
chown dovecot:mail /etc/exim4/domains/$domain/passwd
# Checking if dovecot user exists before set dovecot as owner. If dovecot user doesn't exist (dovecot is not installed), owner is assign to Exim user
if id "dovecot" >/dev/null 2>&1; then
chown -R dovecot:mail /etc/exim4/domains/$domain/passwd
else
chown -R $MAIL_USER:mail /etc/exim4/domains/$domain/passwd
fi
done
fi