Added Colorful Outputs for the Spamhaus info in PF

This commit is contained in:
DerLinkman 2023-06-23 15:54:49 +02:00
parent 408381bddb
commit 7b645303d6

View File

@ -394,8 +394,8 @@ query = SELECT goto FROM spamalias
EOF
if [ -n "$SPAMHAUS_DQS_KEY" ]; then
echo "Detected SPAMHAUS_DQS_KEY variable from mailcow.conf..."
echo "Using DQS Blocklists from Spamhaus!"
echo -e "\e[32mDetected SPAMHAUS_DQS_KEY variable from mailcow.conf...\e[0m"
echo -e "\e[33mUsing DQS Blocklists from Spamhaus!\e[0m"
cat <<EOF > /opt/postfix/conf/dns_blocklists.cf
# Autogenerated by mailcow
postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
@ -429,8 +429,8 @@ EOF
else
if curl -s http://fuzzy.mailcow.email/asn_list.txt | grep $(whois -h whois.radb.net $(curl -s http://ipv4.mailcow.email) | grep -i origin | tr -s " " | cut -d " " -f2 | head -1) > /dev/null; then
echo "The AS of your IP is listed as a banned AS from Spamhaus!"
echo "No SPAMHAUS_DQS_KEY found... Skipping Spamhaus blocklists entirely!"
echo -e "\e[31mThe AS of your IP is listed as a banned AS from Spamhaus!\e[0m"
echo -e "\e[33mNo SPAMHAUS_DQS_KEY found... Skipping Spamhaus blocklists entirely!\e[0m"
cat <<EOF > /opt/postfix/conf/dns_blocklists.cf
# Autogenerated by mailcow
postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
@ -459,8 +459,8 @@ else
dnsbl.sorbs.net=127.0.0.9*2
EOF
else
echo "The AS of your IP is NOT listed as a banned AS from Spamhaus!"
echo "Using the open Spamhaus blocklists."
echo -e "\e[32mThe AS of your IP is NOT listed as a banned AS from Spamhaus!\e[0m"
echo -e "\e[33mUsing the open Spamhaus blocklists.\e[0m"
cat <<EOF > /opt/postfix/conf/dns_blocklists.cf
# Autogenerated by mailcow
postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2