Skip to content

Commit dc562aa

Browse files
committed
Autoreply permission fix. Thanks to l170v
1 parent 9939190 commit dc562aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/v-add-mail-account-autoreply

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
4444
#----------------------------------------------------------#
4545
# Add exim autoreply
4646
echo -e "$autoreply" > $HOMEDIR/$user/conf/mail/$domain/autoreply.$account.msg
47-
chown -R root:mail $HOMEDIR/$user/conf/mail/$domain/autoreply.$account.msg
47+
48+
# Set ownership and permissions
49+
if [ "$MAIL_SYSTEM" = 'exim' ]; then
50+
mail_user=exim
51+
fi
52+
if [ "$MAIL_SYSTEM" = 'exim4' ]; then
53+
mail_user=Debian-exim
54+
fi
55+
chown $mail_user:mail $HOMEDIR/$user/conf/mail/$domain/autoreply.$account.msg
4856
chmod 660 $HOMEDIR/$user/conf/mail/$domain/autoreply.$account.msg
4957

5058

0 commit comments

Comments
 (0)