Browse Source

Merge pull request #2108 from jaapmarcus/fix/anti-virus-add-domain

Disable anti spam/virsus when not installed
Raphael Schneeberger 4 years ago
parent
commit
8b8ecf97fc
1 changed files with 12 additions and 8 deletions
  1. 12 8
      bin/v-add-mail-domain

+ 12 - 8
bin/v-add-mail-domain

@@ -122,15 +122,19 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     if [ ! -z "$local_ip" ]; then
         echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
     fi
-
-    # Adding antispam protection
-    if [ "$antispam" = 'yes' ]; then
-        touch $HOMEDIR/$user/conf/mail/$domain/antispam
+    
+    if [ -n "ANTIVIRUS_SYSTEM" ]; then 
+        # Adding antispam protection
+        if [ "$antispam" = 'yes' ]; then
+            touch $HOMEDIR/$user/conf/mail/$domain/antispam
+        fi
     fi
-
-    # Adding antivirus protection
-    if [ "$antivirus" = 'yes' ]; then
-        touch $HOMEDIR/$user/conf/mail/$domain/antivirus
+    
+    if [ -n "ANTISPAM_SYSTEM" ]; then
+        # Adding antivirus protection
+        if [ "$antivirus" = 'yes' ]; then
+            touch $HOMEDIR/$user/conf/mail/$domain/antivirus
+        fi
     fi
 
     # Adding dkim support