Browse Source

Fix mail template update process

Only trigger mail domain rebuild if mail services are installed on the server, otherwise the script will only update the template set on the file system.
Kristan Kenney 6 years ago
parent
commit
1aac728acc
1 changed files with 6 additions and 4 deletions
  1. 6 4
      bin/v-update-mail-templates

+ 6 - 4
bin/v-update-mail-templates

@@ -40,10 +40,12 @@ fi
 # Update templates
 # Update templates
 cp -rf $HESTIA/install/$type/templates/mail $HESTIA/data/templates/
 cp -rf $HESTIA/install/$type/templates/mail $HESTIA/data/templates/
 
 
-# Rebuilding mail domains
-for user in $($BIN/v-list-sys-users plain); do
-    $BIN/v-rebuild-mail-domains $user no
-done
+# Rebuild mail domains if mail services are enabled
+if [ ! -z $MAIL_SYSTEM ]; then
+	for user in $($BIN/v-list-sys-users plain); do
+		$BIN/v-rebuild-mail-domains $user no
+	done
+fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Hestia                             #
 #                       Hestia                             #