From 5ed473e1c13800fb61b813f60db2c48587ce9dd4 Mon Sep 17 00:00:00 2001 From: cschantz Date: Fri, 6 Feb 2026 16:18:26 -0500 Subject: [PATCH] Add removal request templates for blacklist delisting - Provides copy-paste ready email templates for each blacklist operator - Customized templates for major providers: Spamhaus, Microsoft, Gmail, Apple, Barracuda, Yahoo, and generic template for other RBLs - Templates include proper subject lines, server details, remediation steps - Placeholders for server IP, hostname, admin name, and email - Instructions for users to copy, customize, and submit requests - Reduces friction in delisting process by providing professional templates Each template covers: 1. Professional subject line appropriate for each provider 2. Server identification (IP, hostname) 3. Explanation of remediation actions taken 4. Reference to security/authentication measures 5. Clear call to action for delisting Users can now quickly generate customized delisting requests without needing to research what to include in each email. Co-Authored-By: Claude Haiku 4.5 --- modules/email/email-diagnostics.sh | 221 +++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) diff --git a/modules/email/email-diagnostics.sh b/modules/email/email-diagnostics.sh index 7a036c4..9efc17e 100755 --- a/modules/email/email-diagnostics.sh +++ b/modules/email/email-diagnostics.sh @@ -695,6 +695,227 @@ if [ "$bounced" -gt 0 ]; then echo " 5. Review mail queue for suspicious outbound emails" echo "" + # Show removal request templates for detected blacklists + print_info " 📧 REMOVAL REQUEST TEMPLATES:" + echo "" + + # Function to generate removal template based on blacklist + generate_removal_template() { + local bl_id="$1" + local server_ip="${2:-YOUR_SERVER_IP}" + local server_hostname="${3:-YOUR_SERVER_HOSTNAME}" + local admin_email="${4:-admin@YOUR_DOMAIN.com}" + + case "$bl_id" in + spamhaus) + cat <<'TEMPLATE' +Subject: Delisting Request for [SERVER_IP] + +Dear Spamhaus, + +I am writing to request removal of our mail server from your blacklist (SBL/PBL/ZEN). + +Server Details: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] + +Actions Taken: +1. Verified server is not an open relay +2. Secured server against compromise and abuse +3. Implemented SPF/DKIM/DMARC authentication records +4. Configured proper mail server policies + +We believe our server has been remediated and is no longer a spam source. +Please review and remove our IP from your blocklist. + +Thank you, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + microsoft) + cat <<'TEMPLATE' +Subject: Delisting Request - IP [SERVER_IP] + +Hello Microsoft Sender Support, + +I need to request removal of our mail server IP from the Microsoft/Outlook blocklist. + +Server Information: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] +- Organization: [YOUR_ORGANIZATION] + +Remediation Completed: +1. Resolved the security issue causing the block +2. Verified server authentication (SPF/DKIM/DMARC) +3. Removed malicious content from mail queue +4. Implemented additional security measures + +Our server is now compliant with Microsoft sender requirements. +Please restore our sending reputation. + +Best regards, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + gmail) + cat <<'TEMPLATE' +Subject: Delisting Request - Mail Server [SERVER_IP] + +Hello Gmail Support, + +Our mail server [SERVER_IP] has been blocked due to reputation issues. +We have taken corrective action and request review for restoration. + +Server Details: +- IP Address: [SERVER_IP] +- Reverse DNS: [SERVER_HOSTNAME] + +Actions Taken: +1. Fixed authentication headers and message formatting +2. Implemented DKIM and DMARC signing on all outgoing mail +3. Improved bounce handling procedures +4. Enhanced content filtering for suspicious messages + +We are now complying with Gmail's sender requirements. +Please re-evaluate our server reputation. + +Thank you, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + apple) + cat <<'TEMPLATE' +Subject: Mail Server Delisting Request - [SERVER_IP] + +Hello Apple Support, + +Our organization's mail server [SERVER_IP] has been blocked by Apple's +mail filtering system. We have addressed the underlying issues. + +Server Information: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] + +Remediation Steps Completed: +1. Verified message authentication (SPF/DKIM/DMARC records) +2. Reviewed and removed compromised accounts +3. Implemented additional security hardening +4. Configured proper mail server protocols + +Our server now fully complies with Apple's sender requirements. +Please review and remove the block. + +Sincerely, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + barracuda) + cat <<'TEMPLATE' +Subject: Delisting Request - [SERVER_IP] + +Hello Barracuda Central, + +Our mail server at [SERVER_IP] is listed in your Barracuda Reputation Block List. +We have remediated the issue and request delisting. + +Server Details: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] + +Corrective Actions: +1. Fixed all authentication record issues (SPF/DKIM) +2. Reviewed and removed spam/malware from queue +3. Disabled any open relay vulnerabilities +4. Verified reverse DNS configuration + +We are committed to maintaining sender reputation and complying with best practices. +Please review our request for removal. + +Regards, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + yahoo) + cat <<'TEMPLATE' +Subject: Mail Server Delisting - [SERVER_IP] + +Hello Yahoo Postmaster, + +Our mail server [SERVER_IP] needs to be removed from Yahoo's block list. +We have taken steps to address the issue. + +Server Information: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] + +Steps Taken: +1. Implemented proper email authentication (SPF/DKIM/DMARC) +2. Configured appropriate rate limiting policies +3. Reviewed mail queue for suspicious content +4. Enhanced server security against compromise + +Our server is now configured to meet Yahoo's sender guidelines. +We request review of our IP for delisting. + +Thank you, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + *) + cat <<'TEMPLATE' +Subject: Delisting Request - Mail Server [SERVER_IP] + +Hello [BLOCKLIST_NAME] Support, + +We are writing to request removal of our mail server [SERVER_IP] from your blocklist. + +Server Details: +- IP Address: [SERVER_IP] +- Hostname: [SERVER_HOSTNAME] + +Actions Taken: +1. Identified and fixed the issue causing the listing +2. Implemented proper authentication protocols +3. Enhanced security measures +4. Verified compliance with best practices + +Our server is now properly configured and we believe it should be delisted. +Please review our request. + +Sincerely, +[ADMIN_NAME] +[ADMIN_EMAIL] +TEMPLATE + ;; + esac + } + + # Show templates for each detected blacklist + echo -e "$detected_blacklists" | sort -u | while IFS='|' read -r bl_name bl_url bl_difficulty bl_time; do + if [ -n "$bl_name" ]; then + # Extract ID from name (use first word as ID) + bl_id=$(echo "$bl_name" | cut -d' ' -f1 | tr '[:upper:]' '[:lower:]') + + echo " ─────────────────────────────────────────────────" + echo " 📧 Template for: $bl_name" + echo " ─────────────────────────────────────────────────" + generate_removal_template "$bl_id" "$extracted_ip" "mail.example.com" "admin@example.com" + echo "" + echo " 💡 Copy-paste instructions:" + echo " 1. Copy the template above" + echo " 2. Replace placeholders: [SERVER_IP], [SERVER_HOSTNAME], [ADMIN_NAME], [ADMIN_EMAIL]" + echo " 3. Submit to: $bl_url" + echo "" + fi + done + rm -f "$TEMP_BLACKLISTS" fi