mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
Dovecot is set as owner of several user's files even when dovecot is not installed.
This pull checks 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
This commit is contained in:
parent
180d910131
commit
7121b8a875
3 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -525,7 +525,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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue