Bläddra i källkod

Merge branch 'main' into feature/logging

Kristan Kenney 5 år sedan
förälder
incheckning
e699f7c882
2 ändrade filer med 11 tillägg och 5 borttagningar
  1. 5 4
      bin/v-add-sys-webmail
  2. 6 1
      bin/v-unsuspend-mail-domain

+ 5 - 4
bin/v-add-sys-webmail

@@ -1,12 +1,13 @@
 #!/bin/bash
 # info: add webmail support for a domain
-# options: USER DOMAIN WEBMAIL [RESTART] [QUIET]
+# options: USER DOMAIN [WEBMAIL] [RESTART] [QUIET]
 # labels: hestia
 #
 # example: v-add-sys-webmail user domain.com
+# example: v-add-sys-webmail user domain.com rainloop
+# example: v-add-sys-webmail user domain.com roundcube
 #
-# this function adds support for webmail services
-# to a mail domain.
+# this function enables webmail client for a mail domain.
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #
@@ -51,7 +52,7 @@ if [ -z "$webmail" ]; then
     done
 fi
 
-check_args '3' "$#" 'USER DOMAIN WEBMAIL [RESTART]'
+check_args '2' "$#" 'USER DOMAIN [WEBMAIL] [RESTART]'
 is_format_valid 'user' 'domain'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$IMAP_SYSTEM" 'IMAP_SYSTEM'

+ 6 - 1
bin/v-unsuspend-mail-domain

@@ -60,7 +60,12 @@ decrease_user_value "$user" '$SUSPENDED_MAIL'
 
 # Enable webmail access
 if [ ! -z "$IMAP_SYSTEM" ]; then
-    $BIN/v-add-sys-webmail $user $domain 'yes'
+    if [ ! -z "$WEBMAIL_SYSTEM" ]; then
+        for client in ${WEBMAIL_SYSTEM//,/ };do
+            webmail="$client"
+        done
+        $BIN/v-add-sys-webmail $user $domain $webmail 'yes'
+    fi   
 fi
 # Logging
 $BIN/v-log-action "system" "Info" "Mail" "Unsuspended mail domain (User: $user, Domain: $domain)."