8364593d2f
- Add difficulty ratings (EASY/MODERATE/HARD) to each blacklist entry - Show estimated delisting time for each listed blacklist - Display removal URL directly next to each listed blacklist - Improve summary with difficulty breakdown - Add references to other diagnostic tools (email-diagnostics, history) - Better guidance on delisting process based on difficulty level Database format: rbl_host|name|removal_url|difficulty|time_estimate New features help users prioritize delisting efforts: - EASY listings can typically be removed same day - MODERATE listings require 1-3 days, formal request process - HARD listings may need 3-7+ days, complex procedures Users now see actionable removal URLs directly in the output, reducing need to search for delisting information. Integration with email-diagnostics ecosystem for comprehensive email troubleshooting workflow. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
91 lines
3.4 KiB
Bash
Executable File
91 lines
3.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
################################################################################
|
|
# IP Blacklist Checker
|
|
################################################################################
|
|
# Purpose: Check if server IP is blacklisted
|
|
################################################################################
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
source "$SCRIPT_DIR/lib/common-functions.sh"
|
|
source "$SCRIPT_DIR/lib/system-detect.sh"
|
|
|
|
show_banner "IP Blacklist Checker"
|
|
|
|
# Get server's public IP
|
|
print_info "Detecting server IP address..."
|
|
SERVER_IP=$(curl -s ifconfig.me || curl -s icanhazip.com || curl -s ipecho.net/plain)
|
|
|
|
if [ -z "$SERVER_IP" ]; then
|
|
print_error "Could not detect server IP address"
|
|
exit 1
|
|
fi
|
|
|
|
print_success "Server IP: $SERVER_IP"
|
|
echo ""
|
|
|
|
# Blacklist database with difficulty ratings and removal URLs
|
|
# Format: "rbl_host|display_name|removal_url|difficulty|estimated_time"
|
|
BLACKLISTS_DB=(
|
|
"zen.spamhaus.org|Spamhaus (ZEN)|https://check.spamhaus.org/|HARD|1-7 days"
|
|
"bl.spamcop.net|SpamCop RBL|https://www.spamcop.net/bl.shtml|EASY|Same day"
|
|
"bl.barracudacentral.org|Barracuda|https://www.barracudacentral.org/rbl/removal-request|MODERATE|1-3 days"
|
|
"dnsbl.sorbs.net|SORBS|http://www.sorbs.net/lookup.shtml|MODERATE|1-2 days"
|
|
"cbl.abuseat.org|CBL (Composite Block List)|https://cbl.abuseat.org/lookup.cgi|MODERATE|1-3 days"
|
|
"psbl.surriel.com|PSBL|https://psbl.org/|MODERATE|1-2 days"
|
|
"dnsbl-1.uceprotect.net|UCEPROTECT|http://www.uceprotect.net/en/rblcheck.php|HARD|3-7 days"
|
|
)
|
|
|
|
print_header "Checking Blacklists"
|
|
echo ""
|
|
|
|
LISTED=0
|
|
NOT_LISTED=0
|
|
|
|
# Reverse IP once for all lookups
|
|
REVERSED_IP=$(echo $SERVER_IP | awk -F. '{print $4"."$3"."$2"."$1}')
|
|
|
|
for entry in "${BLACKLISTS_DB[@]}"; do
|
|
IFS='|' read -r rbl_host bl_name removal_url difficulty time_estimate <<< "$entry"
|
|
|
|
# Check if listed
|
|
if host "$REVERSED_IP.$rbl_host" &>/dev/null; then
|
|
print_error "✗ LISTED on $bl_name [$difficulty - $time_estimate]"
|
|
echo " Removal: $removal_url"
|
|
((LISTED++))
|
|
else
|
|
print_success "✓ Not listed on $bl_name"
|
|
((NOT_LISTED++))
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
print_header "Summary"
|
|
|
|
if [ "$LISTED" -eq 0 ]; then
|
|
print_success "✓ Server IP is clean ($NOT_LISTED blacklists checked)"
|
|
echo " Your server is not currently listed on any major blacklists."
|
|
else
|
|
print_warning "⚠ Server IP is listed on $LISTED blacklist(s)"
|
|
echo ""
|
|
print_info "Delisting Difficulty Breakdown:"
|
|
echo " EASY (Same day): Check removal links above - usually automatic"
|
|
echo " MODERATE (1-3 days): Submit formal request, typically responsive"
|
|
echo " HARD (3-7+ days): Complex process, may require documentation"
|
|
echo ""
|
|
print_info "To delist your IP:"
|
|
echo " 1. Review the removal URLs shown above for each listing"
|
|
echo " 2. Identify and fix the underlying issue:"
|
|
echo " - Check for security compromises or spam accounts"
|
|
echo " - Verify SPF/DKIM/DMARC are correctly configured"
|
|
echo " - Review mail queue for suspicious content"
|
|
echo " 3. Submit delisting request with justification"
|
|
echo " 4. Track status using blacklist-check.sh regularly"
|
|
echo ""
|
|
print_info "Additional resources:"
|
|
echo " - Use 'email-diagnostics' for detailed analysis"
|
|
echo " - Check ~/email-diagnostics-history.json for patterns"
|
|
fi
|
|
|
|
echo ""
|