Просмотр исходного кода

Fix for DKIM key permission in v-change-domain-owner

Fix is the same as for v-restore-backup - https://github.com/serghey-rodin/vesta/commit/7815539e915ec8f779c7158891261bdfaff41ee7
dpeca 9 лет назад
Родитель
Сommit
419a9b0b1a
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      bin/v-change-domain-owner

+ 10 - 0
bin/v-change-domain-owner

@@ -144,6 +144,16 @@ if [ ! -z "$mail_data" ]; then
     find $HOMEDIR/$user/mail/$domain -user $owner \
     find $HOMEDIR/$user/mail/$domain -user $owner \
         -exec chown -h $user {} \;
         -exec chown -h $user {} \;
 
 
+    # 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
+    # Chowning mail conf files to exim user
+    find $HOMEDIR/$user/conf/mail/$domain_idn -user root \
+        -exec chown $exim_user {} \;
+
     # Rebuild config
     # Rebuild config
     $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-rebuild-mail-domains $owner no
     $BIN/v-rebuild-mail-domains $owner no