From 3f5f796637ca930bcb71a66c7f61e3ff2ec687a2 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 25 Sep 2013 13:26:05 +0300 Subject: [PATCH] fixes for exim antispam/antivirus protection --- bin/v-add-mail-domain | 5 ++--- bin/v-add-mail-domain-antispam | 7 +++---- bin/v-add-mail-domain-antivirus | 6 ++---- bin/v-delete-mail-domain-antispam | 4 ++-- bin/v-delete-mail-domain-antivirus | 4 ++-- func/rebuild.sh | 7 ++++--- install/rhel/exim.conf | 2 +- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/bin/v-add-mail-domain b/bin/v-add-mail-domain index 19f4d197a..a02ff5c7e 100755 --- a/bin/v-add-mail-domain +++ b/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 diff --git a/bin/v-add-mail-domain-antispam b/bin/v-add-mail-domain-antispam index 1cf1002b0..923e49fc4 100755 --- a/bin/v-add-mail-domain-antispam +++ b/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 # diff --git a/bin/v-add-mail-domain-antivirus b/bin/v-add-mail-domain-antivirus index 6e9e7d884..f0970b2a8 100755 --- a/bin/v-add-mail-domain-antivirus +++ b/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 #----------------------------------------------------------# diff --git a/bin/v-delete-mail-domain-antispam b/bin/v-delete-mail-domain-antispam index 162791f14..1a23ac1ec 100755 --- a/bin/v-delete-mail-domain-antispam +++ b/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 #----------------------------------------------------------# diff --git a/bin/v-delete-mail-domain-antivirus b/bin/v-delete-mail-domain-antivirus index e3ed77402..3b6e0f05b 100755 --- a/bin/v-delete-mail-domain-antivirus +++ b/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 #----------------------------------------------------------# diff --git a/func/rebuild.sh b/func/rebuild.sh index 8d328656d..d67009bb3 100644 --- a/func/rebuild.sh +++ b/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 diff --git a/install/rhel/exim.conf b/install/rhel/exim.conf index 36a0ebcb0..a559c3771 100644 --- a/install/rhel/exim.conf +++ b/install/rhel/exim.conf @@ -1,6 +1,6 @@ ########################################################################## #SPAMASSASSIN = yes -SPAM_SCORE = 10 +SPAM_SCORE = 50 #CLAMD = yes ##########################################################################