Skip to content

Commit 3f5f796

Browse files
committed
fixes for exim antispam/antivirus protection
1 parent 7d63086 commit 3f5f796

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

bin/v-add-mail-domain

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,19 @@ is_package_full 'MAIL_DOMAINS'
4747
mkdir $HOMEDIR/$user/conf/mail/$domain
4848
mkdir $HOMEDIR/$user/mail/$domain_idn
4949
touch $HOMEDIR/$user/conf/mail/$domain/aliases
50-
touch $HOMEDIR/$user/conf/mail/$domain/protection
5150
touch $HOMEDIR/$user/conf/mail/$domain/passwd
5251

5352
# Adding symlink
5453
ln -s $HOMEDIR/$user/conf/mail/$domain /etc/$MAIL_SYSTEM/domains/$domain_idn
5554

5655
# Adding antispam protection
5756
if [ "$antispam" = 'yes' ]; then
58-
echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
57+
touch $HOMEDIR/$user/conf/mail/$domain/antispam
5958
fi
6059

6160
# Adding antivirus protection
6261
if [ "$antivirus" = 'yes' ]; then
63-
echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
62+
touch $HOMEDIR/$user/conf/mail/$domain/antivirus
6463
fi
6564

6665
# Adding dkim

bin/v-add-mail-domain-antispam

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTISPAM'
3939
# Action #
4040
#----------------------------------------------------------#
4141

42-
# Adding antispam key to config
43-
if [ -z "$(grep spam $HOMEDIR/$user/conf/mail/$domain/protection)" ]; then
44-
echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
45-
fi
42+
# Adding antispam flag
43+
touch $HOMEDIR/$user/conf/mail/$domain/antispam
44+
4645

4746
#----------------------------------------------------------#
4847
# Vesta #

bin/v-add-mail-domain-antivirus

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS'
3939
# Action #
4040
#----------------------------------------------------------#
4141

42-
# Adding antivirus key to config
43-
if [ -z "$(grep 'virus' $HOMEDIR/$user/conf/mail/$domain/protection)" ]; then
44-
echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
45-
fi
42+
# Adding antivirus flag
43+
touch $HOMEDIR/$user/conf/mail/$domain/antivirus
4644

4745

4846
#----------------------------------------------------------#

bin/v-delete-mail-domain-antispam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ is_object_value_exist 'mail' 'DOMAIN' "$domain" '$ANTISPAM'
3939
# Action #
4040
#----------------------------------------------------------#
4141

42-
# Delete antispam key
43-
sed -i "/antispam/d" $HOMEDIR/$user/conf/mail/$domain/protection
42+
# Delete antispam flag
43+
rm -f $HOMEDIR/$user/conf/mail/$domain/antispam
4444

4545

4646
#----------------------------------------------------------#

bin/v-delete-mail-domain-antivirus

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ is_object_value_exist 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS'
3939
# Action #
4040
#----------------------------------------------------------#
4141

42-
# Delete antivirus key
43-
sed -i "/antivirus/d" $HOMEDIR/$user/conf/mail/$domain/protection
42+
# Delete antivirus flag
43+
rm -f $HOMEDIR/$user/conf/mail/$domain/antivirus
4444

4545

4646
#----------------------------------------------------------#

func/rebuild.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,21 @@ rebuild_mail_domain_conf() {
418418
ln -s $HOMEDIR/$user/conf/mail/$domain \
419419
/etc/$MAIL_SYSTEM/domains/$domain_idn
420420
rm -f $HOMEDIR/$user/conf/mail/$domain/aliases
421+
rm -f $HOMEDIR/$user/conf/mail/$domain/antispam
422+
rm -f $HOMEDIR/$user/conf/mail/$domain/antivirus
421423
rm -f $HOMEDIR/$user/conf/mail/$domain/protection
422424
rm -f $HOMEDIR/$user/conf/mail/$domain/passwd
423425
touch $HOMEDIR/$user/conf/mail/$domain/aliases
424-
touch $HOMEDIR/$user/conf/mail/$domain/protection
425426
touch $HOMEDIR/$user/conf/mail/$domain/passwd
426427

427428
# Adding antispam protection
428429
if [ "$ANTISPAM" = 'yes' ]; then
429-
echo 'antispam' >> $HOMEDIR/$user/conf/mail/$domain/protection
430+
touch $HOMEDIR/$user/conf/mail/$domain/antispam
430431
fi
431432

432433
# Adding antivirus protection
433434
if [ "$ANTIVIRUS" = 'yes' ]; then
434-
echo 'antivirus' >> $HOMEDIR/$user/conf/mail/$domain/protection
435+
touch $HOMEDIR/$user/conf/mail/$domain/antivirus
435436
fi
436437

437438
# Adding dkim

install/rhel/exim.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##########################################################################
22
#SPAMASSASSIN = yes
3-
SPAM_SCORE = 10
3+
SPAM_SCORE = 50
44
#CLAMD = yes
55
##########################################################################
66

0 commit comments

Comments
 (0)