From 6cf2775e7e03a01436d4f6f07145d24d1b80fa48 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Mon, 31 Jul 2023 12:01:34 +0200 Subject: [PATCH] Fix Reponse Code for ASN Checks --- generate_config.sh | 4 ++-- update.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generate_config.sh b/generate_config.sh index e62b6db5..d09dae9e 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -60,8 +60,8 @@ fi detect_bad_asn() { echo -e "\e[33mDetecting if your IP is listed on Spamhaus Bad ASN List...\e[0m" - response=$(curl --connect-timeout 15 --retry 5 --max-time 30 -s -o /dev/null -w "%{http_code}" "https://asn-check.mailcow.email") - if [ "$response" -eq 403 ]; then + response=$(curl --connect-timeout 15 --max-time 30 -s -o /dev/null -w "%{http_code}" "https://asn-check.mailcow.email") + if [ "$response" -eq 503 ]; then if [ -z "$SPAMHAUS_DQS_KEY" ]; then echo -e "\e[33mYour server's public IP uses an AS that is blocked by Spamhaus to use their DNS public blocklists for Postfix.\e[0m" echo -e "\e[33mmailcow did not detected a value for the variable SPAMHAUS_DQS_KEY inside mailcow.conf!\e[0m" diff --git a/update.sh b/update.sh index 5b8aa9e8..8c5a4fb5 100755 --- a/update.sh +++ b/update.sh @@ -257,8 +257,8 @@ fi detect_bad_asn() { echo -e "\e[33mDetecting if your IP is listed on Spamhaus Bad ASN List...\e[0m" - response=$(curl --connect-timeout 15 --retry 5 --max-time 30 -s -o /dev/null -w "%{http_code}" "https://asn-check.mailcow.email") - if [ "$response" -eq 403 ]; then + response=$(curl --connect-timeout 15 --max-time 30 -s -o /dev/null -w "%{http_code}" "https://asn-check.mailcow.email") + if [ "$response" -eq 503 ]; then if [ -z "$SPAMHAUS_DQS_KEY" ]; then echo -e "\e[33mYour server's public IP uses an AS that is blocked by Spamhaus to use their DNS public blocklists for Postfix.\e[0m" echo -e "\e[33mmailcow did not detected a value for the variable SPAMHAUS_DQS_KEY inside mailcow.conf!\e[0m"