Skip to content

Commit fe52d3a

Browse files
author
enoch85
committed
enable Spamhaus whitlist with private IP ranges
1 parent 95756cd commit fe52d3a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

static/security.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ else
5151
SPAMHAUS
5252
fi
5353

54+
if [ -f $SPAMHAUS ];
55+
then
56+
echo "Adding Whitelist IP-ranges..."
57+
cat << SPAMHAUSconf >> "$SPAMHAUS"
58+
59+
# Whitelisted IP-ranges
60+
192.168.0.0/16
61+
172.16.0.0/12
62+
10.0.0.0/8
63+
SPAMHAUSconf
64+
else
65+
echo "No file exists, so not adding anything to whitelist"
66+
fi
67+
68+
# Enable $SPAMHAUS
69+
sed -i "s|#MS_WhiteList /etc/spamhaus.wl|MS_WhiteList $SPAMHAUS|g" /etc/apache2/mods-enabled/spamhaus.conf
70+
5471
service apache2 restart
5572
if [[ $? > 0 ]]
5673
then

0 commit comments

Comments
 (0)