瀏覽代碼

Added Colorful Outputs for the Spamhaus info in PF

DerLinkman 2 年之前
父節點
當前提交
7b645303d6
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      data/Dockerfiles/postfix/postfix.sh

+ 6 - 6
data/Dockerfiles/postfix/postfix.sh

@@ -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