Преглед изворни кода

fixes for exim antispam/antivirus protection

Serghey Rodin пре 12 година
родитељ
комит
3f5f796637

+ 2 - 3
bin/v-add-mail-domain

@@ -47,7 +47,6 @@ is_package_full 'MAIL_DOMAINS'
 mkdir $HOMEDIR/$user/conf/mail/$domain
 mkdir $HOMEDIR/$user/mail/$domain_idn
 touch $HOMEDIR/$user/conf/mail/$domain/aliases
-touch $HOMEDIR/$user/conf/mail/$domain/protection
 touch $HOMEDIR/$user/conf/mail/$domain/passwd
 
 # Adding symlink
@@ -55,12 +54,12 @@ ln -s $HOMEDIR/$user/conf/mail/$domain /etc/$MAIL_SYSTEM/domains/$domain_idn
 
 # Adding antispam protection
 if [ "$antispam" = 'yes' ]; then
-    echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
+    touch $HOMEDIR/$user/conf/mail/$domain/antispam
 fi
 
 # Adding antivirus protection
 if [ "$antivirus" = 'yes' ]; then
-    echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
+    touch $HOMEDIR/$user/conf/mail/$domain/antivirus
 fi
 
 # Adding dkim

+ 3 - 4
bin/v-add-mail-domain-antispam

@@ -39,10 +39,9 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTISPAM'
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Adding antispam key to config
-if [ -z "$(grep spam $HOMEDIR/$user/conf/mail/$domain/protection)" ]; then
-    echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
-fi
+# Adding antispam flag
+touch $HOMEDIR/$user/conf/mail/$domain/antispam
+
 
 #----------------------------------------------------------#
 #                       Vesta                              #

+ 2 - 4
bin/v-add-mail-domain-antivirus

@@ -39,10 +39,8 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS'
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Adding antivirus key to config
-if [ -z "$(grep 'virus' $HOMEDIR/$user/conf/mail/$domain/protection)" ]; then
-    echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
-fi
+# Adding antivirus flag
+touch $HOMEDIR/$user/conf/mail/$domain/antivirus
 
 
 #----------------------------------------------------------#

+ 2 - 2
bin/v-delete-mail-domain-antispam

@@ -39,8 +39,8 @@ is_object_value_exist 'mail' 'DOMAIN' "$domain" '$ANTISPAM'
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Delete antispam key
-sed -i "/antispam/d" $HOMEDIR/$user/conf/mail/$domain/protection
+# Delete antispam flag
+rm -f $HOMEDIR/$user/conf/mail/$domain/antispam
 
 
 #----------------------------------------------------------#

+ 2 - 2
bin/v-delete-mail-domain-antivirus

@@ -39,8 +39,8 @@ is_object_value_exist 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS'
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Delete antivirus key
-sed -i "/antivirus/d" $HOMEDIR/$user/conf/mail/$domain/protection
+# Delete antivirus flag
+rm -f $HOMEDIR/$user/conf/mail/$domain/antivirus
 
 
 #----------------------------------------------------------#

+ 4 - 3
func/rebuild.sh

@@ -418,20 +418,21 @@ rebuild_mail_domain_conf() {
     ln -s $HOMEDIR/$user/conf/mail/$domain \
         /etc/$MAIL_SYSTEM/domains/$domain_idn
     rm -f $HOMEDIR/$user/conf/mail/$domain/aliases
+    rm -f $HOMEDIR/$user/conf/mail/$domain/antispam
+    rm -f $HOMEDIR/$user/conf/mail/$domain/antivirus
     rm -f $HOMEDIR/$user/conf/mail/$domain/protection
     rm -f $HOMEDIR/$user/conf/mail/$domain/passwd
     touch $HOMEDIR/$user/conf/mail/$domain/aliases
-    touch $HOMEDIR/$user/conf/mail/$domain/protection
     touch $HOMEDIR/$user/conf/mail/$domain/passwd
 
     # Adding antispam protection
     if [ "$ANTISPAM" = 'yes' ]; then
-        echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
+        touch $HOMEDIR/$user/conf/mail/$domain/antispam
     fi
 
     # Adding antivirus protection
     if [ "$ANTIVIRUS" = 'yes' ]; then
-        echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
+        touch $HOMEDIR/$user/conf/mail/$domain/antivirus
     fi
 
     # Adding dkim

+ 1 - 1
install/rhel/exim.conf

@@ -1,6 +1,6 @@
 ##########################################################################
 #SPAMASSASSIN = yes
-SPAM_SCORE = 10
+SPAM_SCORE = 50
 #CLAMD =  yes
 ##########################################################################